Skip to content

Instantly share code, notes, and snippets.

@atkinson
Created October 25, 2011 06:16
Show Gist options
  • Select an option

  • Save atkinson/1311534 to your computer and use it in GitHub Desktop.

Select an option

Save atkinson/1311534 to your computer and use it in GitHub Desktop.
nginx wordpress
root /path/to/wordpress;
index index.php index.html;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
location / {
fastcgi_index index.php;
# if your fast-cgi is somewhere else, change this
fastcgi_pass 127.0.0.1:9000;
# if requested filename does not exist
if (!-e $request_filename) {
rewrite ^.+?(/.*\.php)$ $1 last;
# this is the path from the document_root to wordpress index.html
rewrite ^ /wp/index.php last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment