错误 404.4 您正在寻找的资源没有与之关联的处理程序

man*_*net 7 node.js iis-10

HTTP 错误 404.4 - 未找到您要查找的资源没有与之关联的处理程序。

web.config

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />

                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:3000/{R:1}"  />
                </rule>

            </rules>
        </rewrite>

    </system.webServer>
    </location>
</configuration>
Run Code Online (Sandbox Code Playgroud)

我想重定向mywebsite.com到 http://localhost:3000

  • mywebsite.com在iis和主机文件中
  • http://localhost:3000 是一个运行网站的nodejs
  • 我安装Application Request Routing并url-rewrite
  • 我在站点文件夹上设置了 iusr 权限
  • 重定向适用于我的 Windows Server 2016,但不适用于 win 10

Flá*_*ior 13

您需要启用 IIS 才能将请求路由到 nodejs。

首先,通过在 IIS 网站上下载或使用 IIS 管理器中的“Web 平台安装程序”来下载应用程序请求路由。

接下来,在 IIS 管理器上,选择您的服务器,然后在 IIS 类别下,打开应用程序请求路由缓存。

在屏幕右侧,选择“服务器代理设置...”并在表单中勾选启用代理。

完成这些步骤后,您可能能够正确连接到节点。

供参考:https : //docs.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/creating-a-forward-proxy-using-application-request-routing