Welcome! Log In Create A New Profile

Advanced

Change target host in proxy_pass

Tomasz Kapek
March 17, 2017 07:14AM
Hello,
I have NGINX acting as reverse proxy and I would like to achieve something
like this:

When I get a request like this GET http://app1.mydomain.aa.com/aaa/bbb it
should be converted to:
GET http://app1.mydomain.bb.com/aaa/bbb so such directive will do the job:

proxy_pass http://app1.mydomain.bb.com;
problem is that I want to convert host part automatically (regex) basing on
incoming requests to NGINX - app1.mydomain are not fixed they are changing
very often.
Is it possible? Can anyone get a clue how proxy_pass statement should look
like?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Change target host in proxy_pass

Tomasz Kapek March 17, 2017 07:14AM

Re: Change target host in proxy_pass

Lucas Rolff March 17, 2017 07:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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