Skip to content

Instantly share code, notes, and snippets.

@blt
Created July 25, 2011 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blt/1105020 to your computer and use it in GitHub Desktop.
Save blt/1105020 to your computer and use it in GitHub Desktop.
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