Score:0

IIS 10 bindings. A domain runnning on http and another running on https for same website issue

br flag

So I have a website configured with these bindings (fictional domains / ip addresses here):

http sub.domain.com   port 80    ip 1.2.3.4
http www.somedomain.com port 80  ip 2.2.3.3

Everything works fine, both domains work with the website, however if I add a new https binding to ONE of the domains:

https www.somedomain.com  port 443  ip 2.2.3.3

That messes up the sub.domain.com website. When I go to that website in a browser: http://www.somedomain.com it keeps redirecting to https://www.somedomain.com even though I don't want that one to run on https, I want it on http. If I remove the https binding for the other domain it all works fine again.

Can anyone suggest how I can get round it?

It is IIS 10 on Windows Server 2016 Standard

Paul avatar
br flag
A bit of extra info, when I look at what is happening in Postman, the response is 307 temporary redirect to https://sub.domain.com
bjoster avatar
cn flag
Is the option "SNI" checked at the binding option dialog?
Score:0
br flag

Well it turns out the problem was I had this line of code in my asp.net core web app in Program.cs

app.UseHttpsRedirection();

When I commented that out i'm not getting the undesired redirecting anymore.

I was surprised though that that line of code acts differently depending on some IIS bindings settings, because it only redirects to https depending on the bindings and not always.

Lex Li avatar
vn flag
The 307 response is a good indicator that this issue was caused by the web app itself. Most IIS triggered redirection by default generates 301 responses. Tools like Failed Request Tracing are often used to identify the cause of redirection, and they can help locate the culprit sooner.
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.