Thomas Nyberg
September 03, 2015 12:46AM
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
Subject Author Posted

How to edit url and pass forward to wsgi?

Thomas Nyberg September 03, 2015 12:46AM

Re: How to edit url and pass forward to wsgi?

Francis Daly September 03, 2015 03:46AM

Re: How to edit url and pass forward to wsgi?

Thomas Nyberg September 03, 2015 08:42AM

Re: How to edit url and pass forward to wsgi?

Francis Daly September 03, 2015 02:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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