Nginx rewrite: last & break

locojohn nginx-forum at
Sat Oct 22 14:25:29 UTC 2011

Nginx User Wrote:

> Adding Maxim's statement above into account,
> outside a location block,
> "break" behaves just like "last" does since there
> are no location
> directives to run here.
> Someone just needs to update the docs if this is
> correct.

I have experienced situations when "rewrite something target last;" in
the server {} section generates the 503 page, while "rewrite something
target break;" instead works OK.  It means that "break" does not behave
like "last" in the server section of the virtual host either.


Posted at Nginx Forum:,216965,217052#msg-217052

More information about the nginx mailing list