Skip to content

Instantly share code, notes, and snippets.

@kejinlu
Created May 24, 2011 09:04
Show Gist options
  • Save kejinlu/988388 to your computer and use it in GitHub Desktop.
Save kejinlu/988388 to your computer and use it in GitHub Desktop.
Vanilla的nginx配置
server {
listen 80;
server_name v.geeklu.com;
server_name_in_redirect off;
root /var/www/vanilla;
index index.php index.html;
location / {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?p=$1 last;
}
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment