I have sett up reverse proxy with Nginx reverse proxy is just working fine as expected.
I have another scenario where i need to redirect URL based on matching string using proxy_pass.
This is the rest call i want if URL contains massimodutti.de so it should be route to german servers using proxy_pass
currently i am blank and searching for solution any help will be highly appreciated…
Best Answer
You should use the nginx map feature to map query arguments into
proxy_pass
destinations. It works like this:In the nginx configuration
http
level, you add a map like this:where you replace
default.server
with the domain name for default server andgerman.server
with the domain name for your german server.Then, you use
proxy_pass http://$proxyserver;
in yourserver
block for the reverse proxy destination definition.