Welcome! Log In Create A New Profile

Advanced

Re: Wordpress Multi-Site Converting Apache to Nginx

May 01, 2014 03:02AM
> With wordpress MU setups, you need to manually set up the blog id
> ( well, at least I have so far )... here's some extracts from one of
> my
> site configs:
>
> location ^~ /blogs.dir {

Thanks for sharing your config.

What version of WordPress are you running? Mine doesn't have a blogs.dir directory. I think they did away with that in 3.5. My WPMU setup was working fine without that dir on Apache, so it must not be needed in my version.

> If that still doesn't work, can you check that you've got everything
> connected correctly by delivering a quick <?php phpinfo(); ?> file to
> your browser?

I can make PHP scripts run when I disable the wordpress location blocks and use my CMS's location blocks. The PHP scripts run fine, so PHP and PHP-FPM are running OK.

> There are example configs on the net - wordpress offers one for
> certain, and googling for wordpress, mu and nginx deliver a plethora of howtos.
> Why not begin with one of them and try to understand it, rather than
> fighting to reinvent the wheel?
>

I actually did quite a lot of reading before posting here. There are several reasons the configs out there don't work.

1. WordPress Multi-Site got a major overhaul in 3.5 and the tutorials out there, including Wordpress's own site are for the old version. I'm running 3.9, which uses the new 3.5+ way of detecting blogs.

2. My CMS uses /*/ and /*/*/ (where star is any URL char) type rules to grab everything that isn't otherwise defined explicitly, and this is creating problems with any smart wordpress configs. In order for this to work, I need to hard-code the wordpress blog URLs at a higher priority than the patterns. ie. if /myblog/ or /otherblog/ pass to wordpress, if /*AnythingElse*/ pass to CMS.

3. The CMS, not the wordpress master blog, is at the site root.

4. The actual wordpress files live in a folder /wordpress/ which is not meant to be accessed directly. wordpress expects the blogs to be in subdirectories, such as /wordpress/someblog/, but really, we want them to appear off the root like /someblog/ so we have to trick wordpress using rewrite rules.

This entire configuration was 100% functional using Apache2. I'm assuming that Nginx can emulate any behaviour Apache can, but maybe there's some configs that it can't support?
Subject Author Posted

Wordpress Multi-Site Converting Apache to Nginx

nrahl April 29, 2014 04:27PM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly April 29, 2014 06:42PM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl April 30, 2014 02:46AM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly April 30, 2014 03:16AM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl May 01, 2014 02:07AM

Re: Wordpress Multi-Site Converting Apache to Nginx

GreenGecko May 01, 2014 02:28AM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl May 01, 2014 03:02AM

Re: Wordpress Multi-Site Converting Apache to Nginx

Alan Chandler May 08, 2014 03:32PM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly May 01, 2014 02:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 308
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready