Nginx + Tomcat7 for single webapp and multiple alias domain

cfsego nginx-forum at
Thu Sep 15 03:46:53 UTC 2011

Yes, It is good for you to NGINX in front of your application server,
for that you will gain extra features, ie. load-control and DoS
tolerance for your stability.

And it is simple for you to configure NGINX to use tomcat as backend.
When your tomcat listens localhost:8080, the nginx configuration may be
like this:

>>> location / {
>>>     proxy_pass;
>>>     proxy_set_header        Host $host;
>>>     proxy_set_header        X-Real-IP $remote_addr;
>>>     proxy_set_header        X-Forwarded-For
>>> }

so you will get the clients' real IP from the HTTP header "X-Real-IP"

hope this helps

Posted at Nginx Forum:,215189,215225#msg-215225

More information about the nginx mailing list