Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

How to edit url and pass forward to wsgi? (3 replies)

$
0
0
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:
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html but I've had
no success so far. Thanks a lot for any help.

Cheers,
Thomas

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

Viewing all articles
Browse latest Browse all 7229

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>