# Wordpress Multisite and nginx in a subdirectory

**URL:** <https://www.ruby-forum.com/t/wordpress-multisite-and-nginx-in-a-subdirectory/223142>\
**Category:** NGINX\
**Created:** [September 23, 2012, 10:36pm UTC](https://www.ruby-forum.com/t/wordpress-multisite-and-nginx-in-a-subdirectory/223142 "2012-09-23T22:36:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 23, 2012, 10:36pm UTC](https://www.ruby-forum.com/t/wordpress-multisite-and-nginx-in-a-subdirectory/223142/1 "2012-09-23T22:36:15Z")

</div>

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

> **[nginx – Network admin pointing to root as opposed to subdirectory](https://wordpress.org/support/topic/nginx-network-admin-pointing-to-root-as-opposed-to-subdirectory/?replies=30)**
>
> Support » Networking WordPress » nginx – Network admin pointing to root as opposed to subdirectory nginx – Network admin pointing to root as opposed to subdirectory hgrianev…

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.
