Skip to content

Instantly share code, notes, and snippets.

@iMagesh
Created January 23, 2012 19:50
Show Gist options
  • Save iMagesh/1665198 to your computer and use it in GitHub Desktop.
Save iMagesh/1665198 to your computer and use it in GitHub Desktop.
nginx-wordpress.conf
server {
listen 80;
server_name sub.domain.com;
root /path/to/garden;
index index.php index.html;
location / {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php$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