Score:0

HTTP redirect partially works

in flag

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?

S. Walker avatar
bh flag
We would need to see some of the web config and/or screenshots of IIS. An HTTP redirect is supposed to change the URL that’s in the browser. That’s why your browser gets a 301 status code with a new URL to navigate to. Based on the provided information, your scm site is behaving correctly, and your mail site incorrectly. Is the server that host your Source Control different from the server that hosts exchange? And are both of these different from the one with the redirect configured? How many total servers are there and how are they connected?
Lex Li avatar
vn flag
"act as some sort of proxy" and redirection shows rather brutal an approach. Most professionals will choose the standard reverse proxy approach, https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
Omid Shojaee avatar
in flag
@S.Walker Thanks. There are 3 different servers involved in this setup. All 3 are connected to the same switch. The IIS server is receiving all 80/443 traffic from the Internet (port forwarding of the router).
djdomi avatar
za flag
is this a home lan environment?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.