How to edit url and pass forward to wsgi?

Thomas Nyberg tomnyberg at
Thu Sep 3 04:44:09 UTC 2015


If I have the following directive:

     location ~ /staging/dog/.*/info/cat {
         rewrite /staging/(.+) /$1 break;
         include uwsgi_params;

then a call to `` gets passed 
through to my wsgi handler fine. Now if I leave that directive in place, 
but put the following one before it, then get "502 Bad Gateway":

     location ~ /dog/.*/info/cat {
         include uwsgi_params;

Nothing else was changed. The route is different, the port is different. 
Why would this affect the other one? Is it that I'm somehow "breaking" 
out and _then_ matching the other one?

My question is: how do I _not_ break out? I've tried removing "break" 
but the effect seems exactly the same (i.e. undesired). How do I make it 
so that the url is rewritten and then pass immediately on? I.e. I want 
to _not_ leave the location box once I've matched. Is this possible?

I've searched the internet for a long time and read the docs here: but I've had 
no success so far. Thanks a lot for any help.


More information about the nginx mailing list