0

These are how my rules are setup for a NodeJS application running on Azure:

<rewrite>
  <rules>
    <clear />
    <rule name="Force HTTPS" enabled="true" stopProcessing="false">
      <match url="(.*)" ignoreCase="false" />
      <conditions>
        <add input="{HTTPS}" pattern="off" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
    </rule>
    <rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="iisnode.+" negate="true" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
      <action type="Rewrite" url="app.js" />
    </rule>
  </rules>
</rewrite>

https://example.com/property/101/main-street-condo-&1001 works perfectly. It's an odd tracking code on the end there, but those are the requirements.

http://example.com/property/101/main-street-condo-&1001 requires the HTTP -> HTTPS redirect above to come into play and it fails every time with a cryptic ASP.NET error screen.

Is my rewrite coe missing something?

sean
  • 195
  • 1
  • 1
  • 5
Sean
  • 1

0 Answers0