WordPress multisite

Beeblebrox zaphod at berentweb.com
Fri Feb 28 10:00:38 UTC 2014


I have nginx running on a local intranet server.
I'm trying to setup WordPress multisite with subdirectory, and WP is
located in $document_root/wordpress because there are many other folders
directly under the document_root path.

* I want to access the WP site as http://serv_IP/wp/, but alias does not
work - I must specify http://serv_IP/wordpress/ each time.
location /wp/ {
    alias /document_root/wordpress/;
    try_files $uri $uri/ /index.php?$args;
    include /usr/local/etc/nginx/wordpress.conf;
    fastcgi_pass unix:/var/run/www/php-fpm.sock;  }

nginx-error.log shows: FastCGI sent in stderr: "Primary script unknown"
while reading response header from upstream, client: 192.168.1.100, server:
my.org, request: "GET /wp/ HTTP/1.1", upstream:
"fastcgi://unix:/var/run/www/php-fpm.sock:", host: "192.168.1.100",
referrer: "http://192.168.1.100/"

If I replace in above code "alias" with "root", I just get the
php-information page.

* I'd like to keep nginx.conf clean and pass wordpress.conf using the
include method. How must I modify the code provided in
http://wiki.nginx.org/WordPress, so that the multisite traffic is directed
to the $document_root/wordpress/ folder, and not "/"?

If I pull the try_files code to nginx.conf, startup advises:
nginx: [emerg] "map" directive is not allowed here in
/usr/local/etc/nginx/wordpress.conf:1
Where should the "map $uri $blogname / map $blogname $blogid" code be
placed?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140228/c3896086/attachment.html>


More information about the nginx mailing list