I have localhost:8080 forwarded to mysite1.myhost1.com and localhost:9000 forwarded to mysite2.myhost2.com
I am able to access the websites by localhost:8080 and localhost:9000 resp.
What I want is I want to type mysite1.myhost1.com in browser and it should redirect to localhost:8080 ... that will in turn forward to real mysite1.myhost1.com... Similarly I want to type mysite2.myhost2.com in browser and it should redirect to localhost:9000 ... that will in turn forward to real mysite2.myhost1.com.
Is this possible? I am using apache webserver Please let me know how to achieve this?
It sounds like your solution would be using Apache's Reverse Proxy.
First you have to enable the Apache Proxy Module:
By adding this to your Virtual Hosts file you can pass a request to a different backend server (for example localhost:8080):
If you also want to pass Websocket requests you can add the following below:
Your final config will look similar to this (for mysite1.myhost1.com):
Remember that I used http over https in my example for simplicity, but https is the recommended way.