Fahad Ahammed
Fahad Ahammed

Reputation: 371

Tomcat App Reverse Proxy with Apache http server

i have two app in tomcat which is running in

  1. http://192.168.0.101:8080/app1/
  2. http://192.168.0.102:8080/app2/

I have apache http server running on another system http://192.168.0.100/

Let, i have a public ip connected to 192.168.0.100 server. I want to configure two domain of mine pointed towards http server.

How i can i use apache http server as a revrse proxy of tomcat app ?

<VirtualHost *:80>
ServerName one.app.com
<Location / >
    ProxyPass http://192.168.0.101:8080/app1/
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1
</Location>
</VirtualHost>

Above config just redirect me to http://192.168.0.101:8080/app1/ :(

Upvotes: 0

Views: 1087

Answers (1)

chenchuk
chenchuk

Reputation: 5742

Try this:

<VirtualHost *:80>
    ServerName one.app.com
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1

    ProxyPass /app1 http://192.168.0.101:8080/app1/
    ProxyPassReverse /app1 http://192.168.0.101:8080/app1/

    ProxyPass /app2 http://192.168.0.102:8080/app2/
    ProxyPassReverse /app2 http://192.168.0.102:8080/app2/
</VirtualHost>

Upvotes: 2

Related Questions