Skip to content

Instantly share code, notes, and snippets.

@Laurian
Created January 14, 2012 10:09
Show Gist options
  • Save Laurian/1610890 to your computer and use it in GitHub Desktop.
Save Laurian/1610890 to your computer and use it in GitHub Desktop.
location / {
root /var/www/$host;
index index.php index.html;
if (!-f /var/www/$host/$uri) {
rewrite ^/(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
# Security: must set cgi.fixpathinfo to 0 in php.ini!
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/$host$fastcgi_script_name;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
error_page 404 /index.php;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment