I am thinking about using NGINX instead of Apache to deliver a Tomcat7
webapp on Port :80 to the enduser.
I have the following requirements:
There is a single web-app in the root with any urls (its own
internal urlrewriting). It has various URLs pointing to it for several
languages (and partially other content)
Another admin-webapp exists
My questions are:
(a) would it be a good idea to use NGINX a without Apache Http server,
just with Apache Tomcat7 ?
(b) how can I set this up so that the Tomcat App always know the domain
name the user was using when calling the page?
(c) will the tomcat app still be able to know the IPs of every user?
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:
(a) would it be a good idea to use NGINX a without Apache Http server,
just with Apache Tomcat7 ?
(b) how can I set this up so that the Tomcat App always know the domain
name the user was using when calling the page?
(c) will the tomcat app still be able to know the IPs of every user?
For this you will have to setup a RemoveIpValve 1 in your
context.xml/server.xml/context.xml.default like this:
In nginx you may use configuration provided by cfsego but don’t forget
to add X-Forwarded-Proto if you use https on nginx. Also you may
remove X-Real-IP header because it’s not used in this setup: