Azure Cloud Service redirects http to https does not work (tried answers to many links)

I am trying to perform the “simple” task of redirecting / rewriting traffic from http to https, I have one endpoint in CloudService that is correctly configured for SSL.

I have tried many IIS rewrite rules as below, but no one works. I also tried to configure the rules through Remote Desktop on IIS 8, which also does not work.

When I enter any tag in the Azure web.config file, the rewrite tag has a blue line below it with a message that it is not valid in <system.webServer>:

<system.webServer>
...
      <rewrite>
          <rules>
              <rule name="RedirectToHTTPS" stopProcessing="true">
                  <match url="(.*)" />
                  <conditions>
                      <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                  </conditions>
                  <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
              </rule>
          </rules>
      </rewrite>

  </system.webServer>

Any advice is greatly appreciated.

+4
source share
1

, - HTTP HTTPS!!

HTTP 80, -, . , , HTTP. 80, .

+8

Source: https://habr.com/ru/post/1502771/


All Articles