We have two applications behind our router listening on port 80/443. The router has just one valid IP address. The first application is a mail server and the second one is our source control server.
In this case one solution is to set each application to listen on a different port. This is not desirable for us.
So we have one Windows/IIS server receiving all Internet traffic to act as some sort of proxy.
To do that we have created two sites.
We created the first site as below:
- Bound to
mail.mydomain.com:80
and autodiscover.mydomain.com:443
.
- HTTP Redirect to
http://192.168.50.12
- Redirect
http
to https
And the second site as below:
- Bound to
scm.mydomain.com:80
- HTTP Redirect to
http://192.168.50.85
Both sites send HTTP-301 status code while redirecting.
The first one works well from both internal network and external.
The second one works from internal network but not external. The reason is that when we browse the first site http://mail.mydomain.com
, the URL in the browser's address bar is not changing, but when browsing the second site the URL is changing from http://scm.mydomain.com
to http://192.168.50.85
and obviously doesn't work from outside.
All hosts (mail, autodiscover, scm) are defined in our external DNS as A records pointing to the only valid IP address we have.
Considering that both sites are configured in the exact same way, why that is happening?