0

Thank you in advance for your response,

I've looked on the same question but nowhere to be found, so I'm gonna post here about my question,

So I have a RHEL OS and I have 2 separate IP(See Image)

IP1 is 192.168.10.3 as my web in port 80 IP2 is 192.168.11.3 as my web in port 80(Private)

External access on the firewall from WAN IP mapped to IP1

What I wanna do is when IP1 was accessed externally thru firewall WAN it will route to IP2 instead so I will serve the webpage of IP2, more like a proxy IP1 > IP2. is this possible with apache or nginx? I'm both new on this one and I'm at lost since the IP2 was private network and no internet access only can be, if possible an internal proxy or routing thru IP1.

IP2 cannot be directly mapped to firewall only IP1

will this be achievable from Iptables? like forward the network traffic from IP1:80 to IP2:80 and everytime IP1 is access thru the WAN mapped to, it will show the webpage for IP2?

Every ideas is accepted. Thank you very much community.

Best Regards, Ian

See Image Below

0

As I understand, IP1 as a reverse proxy for IP2. So I suggest you use Nginx to do this as below:

location /route {
    proxy_pass  http://192.168.11.3:80/;
}

Also you can read more about proxy_pass at here. Hope this helps.

  • Hi TienPhan, thank you for your response sir, yes, so by this whenever every request from IP1 will serve pages dedicated for IP2? just to confirm, the server will be hosted by IP1. – Yien May 31 at 3:54
  • sure @Yien you have it. I also explain more clearly flow: client request ---> IP1 then forward ---> IP2. 1. client don't know existing IP2, they only know IP1. 2. when IP1 receives incoming request from client, it follows proxy_pass to forward to destination (IP2). So, you see IP1 is a reverse proxy of IP2. You can have more IP* behinds IP1 with the same approaches. – tien May 31 at 4:46
  • Thanks a lot mate, this sure is solves my problem, i thought I'm gonna do some firewall stuff. Have a great day mate – Yien May 31 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.