Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: using a proxied server as default_server

$
0
0
Hi,

Sorry for not making it more specific, the issue is, the app in the tomcat is a virtual host as well, so it checks 'host' field for 'sample.com', a default_server with specific IP when accessed by a IP address like http://192.168.1.1/, it will not have a 'host', thus when passed to the app in the tomcat, it will not hit the right virtual host there, initially I was thinking, probably nginx can insert the 'host' before proxy to tomcat to make it work.

however, do find a simple solution to this problem, in the default.conf, I added:

localtion / { return 302 http://sample.com;}

and remove the default_server from my virtual host for sample.com

this meets my requirement

thanks,

Angelo

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>