On Mon, Jul 30, 2018 at 02:58:56AM -0400, linsonj wrote: Hi there,
> What we want is when client type https://test1.apphost.com , nginx see url > as test1.apphost.com. Before proxy pass request to tomcat7, it should modify > url to https://test.apphost.com so tomcat7 see client url as > test.apphost.com. Once request is processed, response is given back to nginx > and nginx give it back to end url https://test1.apphost.com Untested, but I suggest you add a upstream test.apphost.com { server 127.0.0.1:8080; } and then make the following changes: > location /server { > > proxy_pass http://127.0.0.1:8080/server; change to proxy_pass http://test.apphost.com; > proxy_set_header Host $host; Remove that. > proxy_redirect off; Remove that. > Would be of great help if someone can advise us how can we modify the url > based on the use case explained above. If you don't add the "upstream", then you should change proxy_set_header Host $host; to proxy_set_header Host test.apphost.com; because that is the Host: header that you say you want tomcat to get. proxy_redirect (http://nginx.org/r/proxy_redirect) will rewrite a http Location: response header, if it is given the chance. The only place I think that this should fail, is if the tomcat service returns http body content which refers to test.apphost.com. Ideally, it shouldn't, or can be configured not to. Good luck with it, f -- Francis Daly [email protected] _______________________________________________ nginx mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx
