Wordpress Multisite and nginx in a subdirectory

Ian Evans ianevans at digitalhit.com
Sun Sep 23 20:36:01 UTC 2012


Okay, we're trying to wrap our heads around a WP config situation in the 
WP support forum:

http://wordpress.org/support/topic/nginx-network-admin-pointing-to-root-as-opposed-to-subdirectory?replies=30

Just curious if anyone here has faced the same issue.

- WP is installed in /blogs. Additional blogs are to be /blogs/blog1, 
blogs/blog2
- WP multisite is activated
- while main site in /blogs works fine under nginx with this 
location(*), network admin links and the multisite database thinks the 
site is suddenly in root instead of /blogs

I'm not exactly sure why the WP support thinks nginx might be causing 
this issue, unless WP is somehow getting some environment variable when 
it installs network support. As far as I understand, I know nginx can 
rewrite locations, but it wouldn't pass an environment along would it?

So I guess my big question is: is anyone here running WP multisite in a 
directory? Did you have the same issue with some admin links pointing to 
root? Should I tell WP support that nginx couldn't be causing this?

Could it possibly be caused by WP's php getting some variable from fastcgi?

WP support's been scratching their heads for about two weeks.

* here's the location:

location ^~ /blogs {
try_files $uri /blogs/index.php?q=$uri;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:10004;
}
}

fastcgi:

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

As I think about this...I'm wondering if it might be the fastcgi.



More information about the nginx mailing list