Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question

migrated from Apr 21 '11 at 20:55

This question came from our site for professional and enthusiast programmers.

Please post the Script / Settings / Details of the Port forwarding. – Stephan B Apr 20 '11 at 6:48

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.