Skip to content

Instantly share code, notes, and snippets.

@kylegibson
Created October 26, 2010 09:56
Show Gist options
  • Save kylegibson/646624 to your computer and use it in GitHub Desktop.
Save kylegibson/646624 to your computer and use it in GitHub Desktop.
nginx WordPress pretty URLs
server {
index index.php;
server_name .kyle-gibson.com;
location /blog {
if (!-e $request_filename) {
rewrite ^/blog/(.+)$ /blog/index.php/$1 last;
}
}
location ~* \.php(/.*)?$ {
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
if (-e $document_root$fastcgi_script_name) {
fastcgi_pass 127.0.0.1:9000;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment