HTTP Redirect partially works

Omid Shojaee 116 Reputation points
2022-04-24T13:06:50.15+00:00

Hello,

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 forwarder.

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 Forward to http://192.168.50.13
  • Redirect http to https

And the second site:

  • Bound to scm.mydomain.com:80
  • HTTP Forward 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 to second site?

Internet Information Services
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful