How to redirect some of the http requests to a machine in a private network?

264 views Asked by At

I have a cluster of computing nodes. Only one node is publicly available (port 80). Other nodes can be accessed through some VPN. Now I host a web service on some node in the cluster, how can I redirect the http requests to the service through the publicly available node using port 80 without VPN? In the meantime, the http requests to the website hosted on public node should not be redirected. On the publicly available node, apache2 is installed and host some other website.

I tried to use iptable to redirect HTTP requests from port 80 on the public node to the service on the other node, but all the HTTP requests (including the requests to the website on the public node) were redirected. I also tried to modify the source IP address but all external IP addresses are hidden within the cluster so it did not work. Any guides or ideas? Thanks.

1

There are 1 answers

3
Muhammad Tariq On

If your nodes are in same subnet then you can access them using Private IP within the cluster. Please check port settings on the other nodes. If you are trying to access a service at, for example node-privateip:8082 on another node, then you will have to open that port on that node.

Also, check the firewall setting. This can be causing the issue. Try to ping from publicly available node to the other nodes and check if you are getting the response.