Welcome! Log In Create A New Profile

Advanced

Re: rewrite or internal redirection cycle

Maxim Dounin
April 20, 2011 09:04PM
Hello!

On Wed, Apr 20, 2011 at 04:21:17PM -0700, Michael Barrett wrote:

> Hi, I have the following rewrite rule:
>
> location = / {
> if ($vanity) {
> rewrite ^/$ /?static_event_cache=1? last;
> }
> }
>
>
> Whenever I hit / & vanity is set I get the following error message:
>
> Apr 20 16:16:58 stage-djcore-www1 nginx: 2011/04/20 16:16:58 [error] 30825#0: *103 rewrite or internal redirection cycle while processing "/", client: 10.203.66.146, server: , request: "GET / HTTP/1.1", host: "awesometown.eventbrite.com"
>
> I get why I have the loop - but I thought (from reading another
> post online) that last would help. Is there anyway to do
> something like this?

The "last" means "stop processing rewrites and search for location
match again". As the same location will match - cycle is
expected.

You probably want "break" instead, i.e. "stop processing rewrites
and handle request here".

See http://wiki.nginx.org/HttpRewriteModule#rewrite for more
details.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite or internal redirection cycle

Michael Barrett April 20, 2011 07:22PM

Re: rewrite or internal redirection cycle

Maxim Dounin April 20, 2011 09:04PM

Re: rewrite or internal redirection cycle

Michael Barrett April 20, 2011 11:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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