Skip to content

Instantly share code, notes, and snippets.

@scribu
Created November 7, 2012 09:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scribu/4030509 to your computer and use it in GitHub Desktop.
Save scribu/4030509 to your computer and use it in GitHub Desktop.
nginx config for multisite in a subdirectory
# site path: /var/www/wp.dev/
# wp path: /var/www/wp.dev/core/
# site url: http://wp.dev/core/
# wp url: http://wp.dev/core/
upstream php {
server unix:/var/run/phpfpm.sock;
}
server {
server_name wp.dev;
root /var/www/wp.dev;
access_log /var/log/nginx/wp.dev-access.log;
error_log /var/log/nginx/wp.dev-error.log;
index index.html index.php;
rewrite ^/core/([_0-9a-zA-Z-]+)/(xmlrpc\.php|wp-[0-9a-z-]+\.php) /core/$2;
rewrite ^/core/([_0-9a-zA-Z-]+)/(wp-(admin|content|includes).*) /core/$2;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php {
include /etc/nginx/fastcgi_params;
fastcgi_pass php;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment