using a proxied server as default_server

angelochen960 nginx-forum at
Fri May 31 11:30:22 UTC 2013


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 '', a
default_server with specific IP when accessed by a IP address like, 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

localtion / { return 302;}

and remove the default_server from my virtual host for

this meets my requirement



Posted at Nginx Forum:,239707,239716#msg-239716

More information about the nginx mailing list