Hello,
If I have the following directive:
location ~ /staging/dog/.*/info/cat {
rewrite /staging/(.+) /$1 break;
include uwsgi_params;
uwsgi_pass 127.0.0.1:3130;
}
then a call to http://127.0.0.1/staging/doc/v0.2/info/cat
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;
uwsgi_pass 127.0.0.1:3030;
}
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:
Module ngx_http_rewrite_module but I’ve had
no success so far. Thanks a lot for any help.
Cheers,
Thomas