Configure webserver:80 to direct a domain name request to a different running webserver:8080 on same machine, different port?

StackOverflow https://stackoverflow.com/questions/264454

  •  06-07-2019
  •  | 
  •  

Question

I run Jetty6 yet gladly place Apache in the front if needs be.

I would like to have two webserver instances running on the same machine on different ports. I would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080.

This should not be visible to web users.

Thank you.

Was it helpful?

Solution

nginx setup as a proxy is a common method for doing this. It has a good reputation and I personally know of several high traffic sites using it with good results.

The twiki has lots of info, and this proxy setup is probably similar to what you're looking for.

OTHER TIPS

just use the mod_proxy of apache could solve your problem

  ProxyRequests Off

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

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

more on apache docs

If I understand your question correctly, you need to enable mod_proxy in Apache, then use this line on the web server running on port 80.

ProxyPassReverse / http://localhost:8080/

This will reverse proxy all requests to port 80 onto port 8080.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top