I am using an ASP.NET Core 1.1 Website on Service Fabric 2.7, this is a public facing website where all communication is done over SSL (port 443).
However, if someone tries to connect to port 80 (http) by mistake, I want to forward them to the same URL but switch to port 443 (https).
My approach to achieving this is having two port listener in the same ASP.NET Core application, as having an additional Stateless service for port redirection seems ridiculous.
My questions are:
- Is there a better trick in forwarding from port 80 to port 443 rather than this one?
- Can I have two listeners in the same ASP.NET Core website? And if so, can you point me to a related resources?
Add a redirect rule to enforce https:
Service manifest:
Communication listeners: