title: HTTPS redirect in Microsoft Azure not working
body: <p>I have an existing portal running on HTTP, some pages run on HTTPS, both currently work fine.  We now want it to only work on HTTPS and redirect any HTTP traffic over to HTTPS URLs as a 301 redirect.  </p>
  
  <p>I have tried a redirect in the global.asax, rewrite rules in the web.config and adding [RequireHttps] to the controller from which all our MVC controllers inherrit but although all of the above solutions work in my Azure emulator, when I deploy it to Azure, it does not respond on HTTP any more. It works fine on HTTPS if you go there directly though.  Telnet to port 80 still works so the server is still responding on port 80 but something is going wrong. </p>
  
  <p>So basically the redirects don't work, the server does not respond correctly on port 80(HTTP), and the server only responds properly on HTTPS now.  If I remove the permanent redirect code, then my portal starts responding on normal HTTP again.</p>
  
  <p>When I run a request to the home page via fiddler, this is the response:</p>
  
  <blockquote>
    <p>HTTP/1.1 504 Fiddler - Receive Failure Date: Mon, 19 Dec 2016 13:02:33
    GMT Content-Type: text/html; charset=UTF-8 Connection: close
    Cache-Control: no-cache, must-revalidate Timestamp: 15:02:33.371</p>
    
    <p>[Fiddler] ReadResponse() failed: The server did not return a complete
    response for this request. Server returned 0 bytes.</p>
  </blockquote>
  
  <p>How can I get it to still respond on HTTP in Azure but with a redirect?</p>