0

I have a web application running on a Linux box using Tomcat6.

I have setup port forwarding so that any requests on port 80 get redirected to port 8080 which works fine.

The problem I have is that the web app makes calls to API's using HTTP (on port 80), so it is unable to send any requests or receive any requests because everything is directed to the web app on port 8080.

Is there any way to allow the server to send/receive on port 80, but external hosts (i.e. users of the web app) connecting to the server are directed to 8080.

Thanks

  • Please post the Script / Settings / Details of the Port forwarding. –  Apr 20 '11 at 06:48

1 Answers1

1

You might be able to use ProxyPass and ProxyPassReverse to proxy some url to 8080, and not do port forwarding.

Get rid of the port forwarding, and create a file in /etc/httpd/conf.d (assuming redhat based linux distro with apache):

ProxyPass /myapp/ http://localhost:8080/
ProxyPassReverse /myapp/ http://localhost:8080/

You can also put path after the http line above if needed.

This basically sets up a reverse proxy, so anything matching the ProxyPass{,Reverse} entries will go to localhost:8080, everything else will get served by the local apache instance.

Obviously if you have a different distro or os or webserver, the above would have to be altered, but the concept is the same.

lsd
  • 1,673
  • 10
  • 10