Welcome! Log In Create A New Profile

Advanced

Re: PHP below server root not served

nano
January 12, 2014 05:28AM
On 11/01/2014 2:34 AM, Francis Daly wrote:
> On Fri, Jan 10, 2014 at 10:37:50PM +1100, nano wrote:
>> On 10/01/2014 8:36 PM, Francis Daly wrote:
>>> On Fri, Jan 10, 2014 at 02:07:34PM +1100, nano wrote:
>>>> On 10/01/2014 7:58 AM, Francis Daly wrote:
>
> Hi there,
>
> This mail is going to sound a bit negative.
>

I find your disposition pleasant and more than generous, not negative at
all, Francis, and I am very grateful for your continued assistance.

>>>>> 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?
>>
>> Is it because "~^ /phpmyadmin/.*\.php$" will be the longest prefix
>> string
>
> No.
>
> "^~" is not the same as "~^". "~^ /" is not the same as "~ ^/".
>

Another presumption on my part, however, where is the nginx regex
documentation? I cannot seem to find it or even what syntax nginx uses.
Also, what is the answer, I still cannot figure it out?

> Read everything very slowly and carefully. The order of the various
> squiggles matters.
>
>>> Each nginx request is handled in one location.
>
>> But, doesn't "...the location
> <snip>
>> used" imply that all requests are subject to the entirety of the
>> configuration file and not just a specific location block?
>
> No. Read it again.
>
> What way of phrasing it would allow you to understand that one location
> is chosen? Perhaps a documentation patch could be provided.
>

I found the request processing page [0] more explicit and, for me,
comprehensible. A cursory look at any search engine result indicates a
lot of people struggle with this point; your suggestion of a
documentation patch might be a good idea. If I actually understood the
logic of this particular point well enough I would happily contribute to
the development of such documentation.

>> For example, if one specifies a location, such as /example/.*\.php$ and
>> assigns certain directives inside that location block, if there are
>> other matching expressions (\.php$) in the configuration file, they
>> could supersede any directives contained within the /example block
>> simply *because they come before the /example block?*
>
> No.
>
> One location is chosen.
>
> The configuration in any other location is irrelevant for this request.
>
> There is no superseding across locations. There is no merging across
> locations. There is only the configuration in, and inherited into,
> the one location that matters for this request.
>
>> It is good; repetition makes practice. And this point you reiterate is a
>> rule I am struggling to understand but that needs to be understood.
>
> After you accept that one location is chosen, then you can start wondering
> about what happens when there are nested locations, or when no locations
> match, and what happens when there are (e.g. rewrite module) directives
> outside of all locations.
>
> But until you accept that one location is chosen, you're unlikely to be
> comfortable making new nginx configurations.
>
> f
>

Thank you, Francis. I need to understand what each prefix and regex
character is and what it does. For example, the documentation is clear
that "^~" prefix will stop the search if it matches the request.
However, there is nothing regarding "~^". This might help me better
construct my location blocks and ensure the correct location is used for
each request.

[0] http://nginx.org/en/docs/http/request_processing.html

--
syn.bsdbox.co <- for dummies

_______________________________________________
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: 187
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