Change target host in proxy_pass

Tomasz Kapek kapekto1 at
Fri Mar 17 11:12:40 UTC 2017

I have NGINX acting as reverse proxy and I would like to achieve something
like this:

When I get a request like this GET it
should be converted to:
GET so such directive will do the job:

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list