location regex issue

Edho P Arief edhoprima at gmail.com
Fri Apr 15 13:27:40 MSD 2011


On Fri, Apr 15, 2011 at 4:23 PM, Boyko Yordanov <b.yordanov at exsisto.com> wrote:
> On Apr 15, 2011, at 12:18 PM, Edho P Arief wrote:
>
>>> I have the following location config:
>>>
>>> location ~* (^/browse/$) {
>>>
>>> And this seems to catch URls like /browse/?page=35 and similar.
>>>
>>> In my understanding the $ (end of line) symbol should make this location work only for /browse/ and nothing more.. or am I wrong?
>>>
>>
>> anything past ? (and ? itself) is argument hence not checked when
>> matching location block.
>
> Got u, thanks!
>
> Then how am I supposed to achieve what I'm after? I need to make this location work for /browse/ only and not for /browse/?args
>


Add a check for $args.

Something like

if ($args == '') { }

(I don't remember exact syntax. Please check nginx wiki for more detail)



More information about the nginx mailing list