<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thanks Francis,<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I directly went back to the basics nginx 101 lesson.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I feel dumb all of a sudden...<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The maze was made of my misconceptions!<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I wonder where they came from. I was sure I tested what I said... which is impossible.<br></div><div class="gmail_extra"><div><div class="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Wed, Dec 9, 2015 at 9:47 AM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Dec 08, 2015 at 06:33:52PM +0100, B.R. wrote:<br>
<br>
Hi there,<br>
<br>
</span><span class="">> That means the following is a 'prefix' location block:<br>
> location /whatever/ {<br>
> }<br>
><br>
> That said, this block will match the /whatever/ string anywhere in the URI<br>
> string, not only at its start.<br>
<br>
</span>No, it won't.<br>
<br>
===<br>
    location / {<br>
        return 200 "in location /\n";<br>
    }<br>
<br>
    location /aaa/ {<br>
        return 200 "in location /aaa/\n";<br>
    }<br>
===<br>
<br>
$ curl <a href="http://localhost/aaa/bbb/" rel="noreferrer" target="_blank">http://localhost/aaa/bbb/</a><br>
in location /aaa/<br>
<br>
$ curl <a href="http://localhost/bbb/aaa/" rel="noreferrer" target="_blank">http://localhost/bbb/aaa/</a><br>
in location /<br>
<span class=""><br>
> As a consequence, to me, the meaning of 'prefix' was not tied to the<br>
> location of the matched string in the URI, but rather a definition more<br>
> like 'matching a string in the URI'.<br>
<br>
</span>No.<br>
<br>
"prefix" has its normal English language meaning. The documentation at<br>
<a href="http://nginx.org/r/location" rel="noreferrer" target="_blank">http://nginx.org/r/location</a> is correct.<br>
<br>
(I think the documentation there is *incomplete*, as it is not immediately<br>
clear to me how nested locations are searched. But that has been clarified<br>
on the mailing list recently, and that clarification matches what can<br>
be seen in tests.)<br>
<span class=""><br>
> Where is the exit of the maze again?<br>
<br>
</span>prefix matches -- without modifier, with modifier ^~, and (technically,<br>
probably) with modifier = -- are exact string matches at the start of<br>
the url. (And consequently should all start with the character "/".)<br>
<br>
If you want to match something that is not an exact string match at the<br>
start of the url, you must use something that is not a prefix match.<br>
<div class="HOEnZb"><div class="h5"><br>
        f<br>
--<br>
Francis Daly        <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div></div>