如何在 IIS 反向代理上启用 SSL 卸载

Ami*_*eem 1 windows iis reverse-proxy arr

我刚刚通过启用应用程序请求路由 (ARR) 并按照本文编辑 web.config 文件,为 Windows Server 上的 NodeJS 应用程序启用了反向代理:

https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

现在,一切工作正常,我可以从服务器外部的外部客户端访问在本地主机上运行的 NodeJS 应用程序。我想强制与我刚刚创建的反向代理建立 Https 连接。我该如何实现这一目标?

Abr*_*ian 5

IIS URL Rewrite 扩展可以完成此任务。请安装扩展。
https://www.iis.net/downloads/microsoft/url-rewrite
为了强制 HTTP 连接为 https 连接,请在webconfigIIS 可以识别的文件中添加以下 Url 规则。

<system.webServer>
           <rewrite>
            <rules>
              <rule name="Force SSL (https)" enabled="true" stopProcessing="false">
                <match url="(.*)" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                  <add input="{HTTPS}" pattern="off" />
                </conditions>
                <action type="Redirect" url="https://example.com/{REQUEST_URI}" redirectType="Permanent" />
              </rule>
            </rules>
          </rewrite>
    </system.webServer>
Run Code Online (Sandbox Code Playgroud)

或者,我们可以在安装后使用 URL 重写扩展来手动设置规则。
在此输入图像描述
在此输入图像描述
在此输入图像描述
如果有什么需要我帮忙的,请随时告诉我。

  • 在哪里配置 SSL 卸载? (2认同)