Skip to content

Instantly share code, notes, and snippets.

@blt
Created Jul 25, 2011
Embed
What would you like to do?
server {
listen 80;
root /var/www/;
index index.html index.htm index.php;
server_name dev.example.com
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.php;
}
location /(?P<foo>[a-Z0-9])/[a-Z]*\.php {
# Rewrite $uri
rewrite ^ /$foo/public/index.php break;
}
error_page 404 /404.html;
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
fastcgi_pass unix:/tmp/example_php-fpm.socket;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment