Skip to content

Instantly share code, notes, and snippets.

@pviojo
Created June 14, 2012 00:04
Show Gist options
  • Save pviojo/2927238 to your computer and use it in GitHub Desktop.
Save pviojo/2927238 to your computer and use it in GitHub Desktop.
Nginx conf. Wordpress blog in a subdirectory (/blog)
server {
listen 80;
server_name <domain>
server_name_in_redirect off;
access_log logs/<domain>.access.log;
error_log logs/<domain>.error.log;
gzip_static on;
root /www/<domain>;
index index.php;
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location /blog {
try_files $uri $uri/ /blog/index.php?q=$uri&$args;
}
location ~ .*\.php[345]?$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment