Welcome! Log In Create A New Profile

Advanced

Re: Nginx bug when mixing map and try_files ?

Mr Alex
October 07, 2020 02:44PM
stfu

On Wed, Oct 7, 2020 at 9:35 PM Marcin Wanat <marcin.wanat@gmail.com> wrote:

> Hi,
>
> On Wed, Oct 7, 2020 at 8:08 PM Francis Daly <francis@daoine.org> wrote:
>
>
>> $1 may not mean what you want it to mean, when more than one regex-thing
>> is involved. And "map" can be a regex-thing.
>>
>> If you change the location regex to whatever your engine's version of
>> "save this in a named variable" is, then use that named variable in the
>> try_files line, you may have better luck.
>>
>> Perhaps:
>>
>> location ~ ^/imgs/(?P<numbers>[0-9]*)/(.*)$ {
>>
>> and use $numbers instead of $1.
>>
>> When nginx needs to know the value of $webp_suffix, the "map" is used,
>> which messes with your $1.
>>
>> Then when nginx substitutes in the value of $1, it is not what it was
>> from the regex location.
>>
>> So it all Just Works when $webp_suffix does not need to be read.
>>
>>
> This is exactly the problem! Thank you!
>
> Regards,
> Marcin Wanat
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx bug when mixing map and try_files ?

Marcin Wanat October 07, 2020 12:52PM

Re: Nginx bug when mixing map and try_files ?

Francis Daly October 07, 2020 02:10PM

Re: Nginx bug when mixing map and try_files ?

Marcin Wanat October 07, 2020 02:36PM

Re: Nginx bug when mixing map and try_files ?

Mr Alex October 07, 2020 02:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 53
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