Welcome! Log In Create A New Profile

Advanced

Re: v1.0.4, bugreport: location directive

ruv
June 16, 2011 12:08PM
ruv Wrote:
> Другой эпизод:
>
> location / { # 1
> rewrite ^ / redirect ;
> }
> location /test { # 2
> rewrite ^ /unavailable.gif ;
> }
>
> При запросе "/test" делает
> редирект на корень
> (срабатывает первый location?),
> вместо отдачи unavailable.gif.

Походу, с этим понятно.
После rewrite модифицированный URL снова проходит через сопоставление с locations. Поэтому, надо добавить:
location = /unavailable.gif { } # для исключения последующего попадания в location # 1
либо поставить break

location /test { # 2
rewrite ^ /unavailable.gif break;
}

--
Ruvim
Subject Author Posted

v1.0.4, bugreport: location directive

ruv June 16, 2011 11:36AM

Re: v1.0.4, bugreport: location directive

Alexander Kochetov June 16, 2011 12:04PM

Re: v1.0.4, bugreport: location directive

ruv June 16, 2011 12:20PM

Re: v1.0.4, bugreport: location directive

Igor Sysoev June 16, 2011 02:16PM

Re: v1.0.4, bugreport: location directive

Alexander Moskalenko June 16, 2011 04:10PM

Re: v1.0.4, bugreport: location directive

ruv June 19, 2011 05:46PM

Re: v1.0.4, bugreport: location directive

Sergey Shepelev June 19, 2011 06:12PM

Re: v1.0.4, bugreport: location directive

ruv June 16, 2011 12:08PM

Re: v1.0.4, bugreport: location directive

ruv June 28, 2011 11:47AM

Re: v1.0.4, bugreport: location directive

Igor Sysoev June 28, 2011 11:56AM

Re: v1.0.4, bugreport: location directive

ruv June 28, 2011 12:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready