Welcome! Log In Create A New Profile

Advanced

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly
May 01, 2014 02:58AM
On Thu, May 01, 2014 at 02:07:49AM -0400, nrahl wrote:

Hi there,

> This is the entire config now:
>
> location ^~ /wordpress/ {
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> }

That says "talk fastcgi to that socket", but nothing useful is sent on
that connection because you have no fastcgi_param directives there. (And
no indication that any are inherited from the surrounding context.)

So php will not be asked to process any particular file.

You'll probably want SCRIPT_FILENAME, and possibly some more params,
to get any kind of useful output. The details depend on your fastcgi
server, but the nginx fastcgi.conf is usually a good starting point.

> location / {
> return 403;
> }
>
> That's all the location blocks.
>
> What happens:
> 1. Going to any page that does not start with /wordpress/ produces a 403.
> This is correct according to my understating of the config.

Yes, that's what the config asks for.

> 2. Going to any url starting with /wordpress/ like /wordpress/wp-admin/ or
> even just /wordpress/ itself, produces a blank page.

Yes, that's what the config asks for.

Strictly, it provides "whatever the fastcgi server returns"; but since
that is "nothing", that's what you get. The fastcgi server logs may have
more details.

> < X-Powered-By: PHP/5.5.9-1ubuntu4

So, nginx sent the request to the fastcgi server. That's good.

> > The logs will show which location is used. Can you see which
> > file-on-the-filesystem is returned?
>
> For the request /wordpress/ with above simple config, it matches the
> /wordpress/ location and passes it to fastcgi:

That's true of this config and test. The question was about the raw
wp-admin.php content that you reported with a previous config.

But it sounds like you're progressing with getting the config to do what
you want, so that's good.

> the log says: http upstream request: "/wordpress/?"
> then: http fastcgi record length: 61
> which seems a bit short. So PHP is returning nothing?

Correct. PHP processes the named input file, which you haven't set,
so it processes nothing and returns the output.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 220
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