Reverse proxy for multiple apps, tomcat

Hi,

I’m setting up a reverse proxy to be used by different applications
working on a tomcat server. The configuration, is using proxy_pass
directive but it’s not working, have searched but I’ve been able to
figure it out.

The scenario is like this:

|---------------------------|
| (NginX) |
-----------------------|-------------------------------------------------|-------------------------------------------------|
|---------------------------|
|||
(http://www.app1.com) _________
(http://www.app2.com) ________(http://www.app3.com)
||
|
||
|
-----------------------
|/
||
|
___________| ------>
http://tomcat1:8080/app1__________________\|/___________________________|
| Tomcat 1_____|
-------------------------------------------------------->
http://tomcat1:8080/app2__________________\|/
| (192.168.0.1) _|
------------------------------------------------------------------------------------------------------>
http://tomcat1:8080/app3

If anyone can help with this questions:

1.- Do I need to set different IP for each app on the tomcat server?
currently my apps are on: http://Tomcat:8080/app1,
http://Tomcat:8080/app2, http://Tomcat:8080/app3 all on the same IP.

2.- Currently I’ve a config but it seems to have problems with the fact
that I need to publish the application as a root let’s say
http://www.app1.com but this should point to my tomcat on
http://tomcat1:8080/app1.

Thanks for your help,

Posted at Nginx Forum: