My setup is in question consists of three servers. The internet facing firewall, a reverse proxy server in the DMZ, and a web server in the LAN.
The information of my setup is like this:
URL of my website: webmail.domain.com
Firewall Public IP: 10.10.10.10
DMZ IP: 220.127.116.11
Web Server IP: 18.104.22.168
Delegate is installed on the DMZ server listening on port 6050.
The desired behavior is like this: when I put in the address in my browser, which is webmail.domain.com, the firewall would NAT port 80 to port 6050 of the DMZ Delegate server. Delegate would then reverse proxy to the web server and get the correct page.
However the complication is that when access the webpage internally, you have to put http://22.214.171.124/gw/webacc as the URL, which means that Delegate has to rewrite and reverse proxy to this website.
The configuration file is like this:
The problem is:
When I put webmail.domain.com in the address bar, the page loads but the URL becomes http://webmail.domain.com// (notice the double slashes at the end).
When I log in to the webmail, the URL rewrites to http://webmail.domain.com//gw/webacc and the page says object not found, the log shows that is trying to get the page http://126.96.36.199/gw/webacc/gw/webacc, which is why it's broken. I believe this has something to do with the webmail program, it just automatically append the /gw/webacc at the end. But is there a way stop rewriting the URL once it sees the /gw/webacc at the end?
So what should be the correct conf file? Sorry for the long email, I appreciate it if you could help.
This message (and any associated files) may contain confidential and/or privileged information. If you are not the intended recipient or authorized to receive this for the intended recipient, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by sending a reply e-mail and delete this message. Thank you for your cooperation.