Welcome! Log In Create A New Profile

Advanced

Re: Some Issues with Configuration

March 06, 2014 12:18AM
Hi!

On Wed, 2014-03-05 at 21:18 +0000, Richard Ibbotson wrote:
> On Wednesday 05 Mar 2014 21:03:22 Jonathan Matthews wrote:
> > Nginx doesn't execute PHP. It passes each request destined for your
> > blog (i.e. the locations you decide are "your blog") to another
> > process that runs/is-running the PHP. Take a look here, and it might
> > help:
>
> >> http://wiki.nginx.org/WordPress<<
>
> I'll have a read through this again. The part that might work is...
>
> location /blog {
> try_files $uri $uri/ /blog/index.php?$args;
> }
>
> location ~ \.php$ {
> fastcgi_split_path_info ^(/blog)(/.*)$;
> }
>
> But... I have not just /blog but others. Such as /journalism and
> others. Do I just put in another location for that ? Such as ....
>
> location /journalism {
> try_files $uri $uri/ /journalism/index.php?$args;
> }
>
> location ~ \.php$ {
> fastcgi_split_path_info ^(/journalism)(/.*)$;
> }
>
> > If you're still stuck, please have a google before asking more
> > questions here. There are many, many, *many* articles out there,
> > explaining how to get Nginx+PHP/WordPress working, and the config
> > you posted above strongly suggests you've not read any of them yet!
> > The Internet is your friend ... ;-)
>
> I spent a month doing that. Been going to ApacheCon since 2001. Done
> most international GNU/Linux and BSD conferences. Seen a few things.
> I'm a bit lost on NGINX configuration. Something new to learn :)
>

Nginx is just acting as a switch here, so in the location block for .php
files, you need to hand over to php for further processing. This is
usually done via fastcgi to php-fpm - especially for the performance
gains after using APC, etc...

You can do this in one of two ways: I use the more convoluted one...

in nginx.conf, define a php backend:

http {
...
upstream backend {
server unix:/var/run/php5-fpm.sock;
}
}

( ensure that the php-fpm process is listening on that socket - you can
also use ports )

in the site config pass them over:

location ~ \.php$ {
fastcgi_split_path_info ^(/journalism)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass backend;
}

That should approximately do it - depending on the contents
of /etc/nginx/fastcgi-params which I modified years ago!

hth,

Steve
--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Some Issues with Configuration

Richard Ibbotson March 05, 2014 06:14AM

Re: Some Issues with Configuration

Jonathan Matthews March 05, 2014 04:04PM

Re: Some Issues with Configuration

Richard Ibbotson March 05, 2014 04:20PM

Re: Some Issues with Configuration

Jonathan Matthews March 05, 2014 04:48PM

Re: Some Issues with Configuration

Richard Ibbotson March 08, 2014 04:04PM

Re: Some Issues with Configuration

Francis Daly March 09, 2014 07:08AM

Re: Some Issues with Configuration

GreenGecko March 06, 2014 12:18AM

Re: Some Issues with Configuration

Richard Ibbotson March 10, 2014 05:56PM

Re: Some Issues with Configuration

Francis Daly March 11, 2014 04:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
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