Created
June 14, 2012 00:04
-
-
Save pviojo/2927238 to your computer and use it in GitHub Desktop.
Nginx conf. Wordpress blog in a subdirectory (/blog)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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