Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite url without causing redirect and proxy to backend app

nanaya
November 03, 2015 10:44PM
On Wed, Nov 4, 2015, at 05:27 AM, kodeninja wrote:
> Howdy, everyone!
>
> I'm trying to figure out if there's a way to achieve this with nginx:
> http://stackoverflow.com/questions/33427101/nginx-rewrite-url-without-causing-redirect-and-proxy-to-backend-app.
> I didn't get response on the SO question yet, so trying my luck here :).
>
> Please let me know if this is possible.


A request URI is passed to the server as follows:

If the proxy_pass directive is specified with a URI, then when a
request is passed to the server, the part of a normalized request
URI matching the location is replaced by a URI specified in the
directive:

location /name/ {
proxy_pass http://127.0.0.1/remote/;
}


http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

Also in case of rewrite you probably want `break` since `last` restart
location matching process

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

nginx rewrite url without causing redirect and proxy to backend app

kodeninja November 03, 2015 03:27PM

Re: nginx rewrite url without causing redirect and proxy to backend app

nanaya November 03, 2015 10:44PM

Re: nginx rewrite url without causing redirect and proxy to backend app

kodeninja November 04, 2015 09:05PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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