Skip to content

Instantly share code, notes, and snippets.

@thomasm0
Last active March 18, 2016 09:42
Show Gist options
  • Save thomasm0/4b34c6fb24dcbe46d801 to your computer and use it in GitHub Desktop.
Save thomasm0/4b34c6fb24dcbe46d801 to your computer and use it in GitHub Desktop.
Local WordPress Multisite (Sub-Directories) for Nginx Conf
server {
listen 80;
root /var/www/site-directory.dev/app/www;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
server_name sitedomain.dev;
location / {
try_files $uri $uri/ /index.php?$uri&args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last;
rewrite ^(/[^/]+)?(/.*\.php) /wp$2 last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment