IIS通过URL重写配置http跳转https,排除部分域名
设置http强制跳转https,请参考:
https://tech.powereasy.net/cpzsk/dynetbbcjwt/content_21000
但是IP访问需要不跳转,添加<add input="{HTTP_HOST}" pattern="^192.168.0.102$" negate="true" />即可
<rewrite>
<rules>
<rule name="https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
<add input="{HTTP_HOST}" pattern="^192.168.0.102$" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
</rules>
</rewrite>