[moderatio note: threads are merged]
Hi,
since the thread is closed, and I was wrong by saying it’s all working, you might want to link this solution, or even update a post (there’s a fair chance that main site is wp too).
With previous nginx configuration my multisite in subdirectory was working, but permalinks on the main site didn’t. I just noticed that, and I wanted to post a solution here:
server {
server_name www.main.com main.com;
access_log /var/log/nginx/main.com.access.log;
error_log /var/log/nginx/main.com.error.log debug;
root /srv/www/main.com/public_html;
index index.php;
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/multisite(/[^/]+)?(/wp-.*) /multisite$2 last;
rewrite ^/multisite(/[^/]+)?(/.*\.php)$ /multisite$2 last;
}
location / {
try_files $uri $uri/ /index.php?$args ;
}
# Remember to change multisite to your subdirectory name
location /multisite {
try_files $uri $uri/ /multisite/index.php?$args ;
}
location ~ \.php$ {
try_files $uri /multisite/index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|d$
access_log off; log_not_found off; expires max;
}
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}