Welcome! Log In Create A New Profile

Advanced

Re: PHP below server root not served

Francis Daly
January 10, 2014 04:38AM
On Fri, Jan 10, 2014 at 02:07:34PM +1100, nano wrote:
> On 10/01/2014 7:58 AM, Francis Daly wrote:

Hi there,

just some quick responses to parts...

> It was my mistake assuming Apache logic[0] would be used.

Yes -- in general, in Apache, the configuration that applies to a request
can come from multiple places. In nginx, it comes from one location,
plus the surrounding contexts.

> I mean to say, even though location 4 contains its own config, the
> config from location 2 is globally used, thus rendering location 4
> requests broken.

Per nginx logic, location 4 is used for every request for which it is the
"best match". It just happens that there are no such requests. It's the
administrator's job to spot this "brokenness".

> I still find this confusing: why has this move not broken the generic
> location ~\.php$ block, which now comes after the location
> /phpmyadmin/(.*\.php)$ block, rendering root requests (sitename.com)
> broken? The inverse breaks the /phpmyadmin/(.*\.php)$ config.

What request do you make?

What (top-level) location{}s do you have?

Which one location will be chosen for the request?

Try those questions with each of the requests you care about, and see
if you can see why it works.

> >When nginx chooses the one location to use for a request, it chooses
> >the one top-level location{} block to use. Within that block, if there
> >are further choices to make, they are independent.
>
> More clarification! Your explanations are really helpful. How will
> having ~\.php$ nested inside ^~ /phpmyadmin affect the main site
> (server root / sitename.com) WordPress administration of PHP? (I think
> you may have already answered this with your upcoming example.)

The same questions apply:

What request do you make?

What (top-level) location{}s do you have?

Which one location will be chosen for the request?

> >The suggestion is along the lines of:
> >
> > location ^~ /phpmyadmin/ {
> > location ~ \.php$ {

At this point, you could instead use "location ~
^/phpmyadmin/.*\.php$". It will match exactly the same requests --
can you see why?

Depending on the rest of your setup, there may be a reason to use this.

> So, PHP directives, such as fastcgi_param SCRIPT_FILENAME, contained
> within the ~ \.php$ location nested inside the ^~ /phpmyadmin/ location
> will not apply to the rest of the site -- only to /phpmyadmin? The
> subsequent location ~ \.php$ applies to the rest of the site?

Each http request is independent.

Each nginx request is handled in one location.

For each request, only the configuration in, or inherited into, the one
location, applies.

This may seem repetitive; that's because it is. Until you understand
that point, you will not understand nginx configuration.

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

SSL ciphers, disable or not to disable RC4?

Anonymous User January 09, 2014 04:30AM

Re: SSL ciphers, disable or not to disable RC4?

nano January 09, 2014 04:44AM

Re: SSL ciphers, disable or not to disable RC4?

Jeffrey Walton January 09, 2014 04:54AM

RE: SSL ciphers, disable or not to disable RC4?

Lukas Tribus January 09, 2014 04:54AM

Re: SSL ciphers, disable or not to disable RC4?

Jeffrey Walton January 09, 2014 05:06AM

PHP below server root not served

nano January 09, 2014 05:26AM

Re: PHP below server root not served

Richard Stanway January 09, 2014 05:30AM

Re: PHP below server root not served

nano January 09, 2014 05:34AM

Re: PHP below server root not served

Francis Daly January 09, 2014 05:56AM

Re: PHP below server root not served

nano January 09, 2014 06:46AM

Re: PHP below server root not served

nano January 09, 2014 07:42AM

Re: PHP below server root not served

B.R. January 09, 2014 08:00AM

Re: PHP below server root not served

nano January 09, 2014 08:52AM

Re: PHP below server root not served

Francis Daly January 09, 2014 04:00PM

Re: PHP below server root not served

nano January 09, 2014 10:08PM

Re: PHP below server root not served

Francis Daly January 10, 2014 04:38AM

Re: PHP below server root not served

nano January 10, 2014 06:40AM

Re: PHP below server root not served

Francis Daly January 10, 2014 10:36AM

Re: PHP below server root not served

nano January 12, 2014 05:28AM

Re: PHP below server root not served

Francis Daly January 14, 2014 05:14PM

Re: PHP below server root not served

Valentin V. Bartenev January 15, 2014 02:20PM

Re: PHP below server root not served

nano January 10, 2014 04:38AM

Re: PHP below server root not served

nano January 09, 2014 09:44AM

Re: PHP below server root not served

Jim Ohlstein January 09, 2014 12:14PM

Re: PHP below server root not served

nano January 09, 2014 12:30PM

Re: SSL ciphers, disable or not to disable RC4?

Axel January 12, 2014 12:44PM

Re: SSL ciphers, disable or not to disable RC4?

Darren Pilgrim January 12, 2014 02:10PM

Re: SSL ciphers, disable or not to disable RC4?

Axel January 13, 2014 04:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 67
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready