Some Issues with Configuration
Jonathan Matthews
contact at jpluscplusm.com
Wed Mar 5 21:46:42 UTC 2014
On 5 March 2014 21:18, Richard Ibbotson <richard.ibbotson at gmail.com> 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)(/.*)$;
> }
Your indenting is/might-be misleading. Are you intending to
encapsulate the PHP regex inside the /blog prefix, as your indenting
suggests? 'Cos your braces aren't doing that.
> 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)(/.*)$;
> }
In general, each request is handled in one location and one location
*only* in nginx. There are some directives which inherit down config
levels (http{}, server{}, location{}, nested location {}) but they're
not the ones you'll (probably) be caring about here.
If you can, pop your blog on its own FQDN so you can seperate out
traffic into different server{} stanzas. That works well as a base
level of distinction between traffic which should hit PHP and that
which shouldn't.
>> 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 :)
Apologies - I assumed from the config you posted you'd not done any reading :-)
Nothing you've posted yet specifies the method you're using to talk to
your PHP-executing process. Perhaps you should post a more complete
config and let us know what you've tried already ...
J
More information about the nginx
mailing list