question

OmidShojaee avatar image
0 Votes"
OmidShojaee asked Bruce-SqlWork answered

HTTP Redirect partially works

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?



windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered

Sounds like the non working site is not honoring the x-forward header. Check its configuration or support of proxy headers.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.