首页 > 解决方案 > Windows Server 2012 我无法使用 IIS 和 IISNode 从外部访问我的 url

问题描述

我有一个 MEAN Stack 应用程序(Node.js、Angular、MySql、Express),我创建了一些 api,并使用 iis 站点构建,在端口 80 上构建 iisnode.local,并添加带有反向代理的 web.config,但是当我尝试从外部浏览器调用不打开任何东西

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:3000/{R:1}" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:3000/(.*)" />
                    <action type="Rewrite" value="http{R:1}://iisnode.local/{R:2}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
    </system.webServer>
</configuration>

这是网站绑定的数据

在此处输入图像描述

在此处输入图像描述

<sites>
      <site name="IISNode" id="9" serverAutoStart="true">
        <application path="/" applicationPool="IISNode">
          <virtualDirectory path="/" physicalPath="D:\node\mate_market\backend" />
        </application>
        <bindings>
          <binding protocol="http" bindingInformation="IP-SERVER:80:iisnode.local" />
        </bindings>
      </site>

标签: node.jsexpressiiswebserver

解决方案


推荐阅读