node.js - 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>
解决方案
推荐阅读
- python - BeautifulSoup - 亚马逊和谷歌将我识别为机器人;我该如何解决?
- google-drive-api - 更改了本地 Google 文档文件中的内容?
- python - 如何遍历多个数据帧的特定列,然后比较它们的值以找到最大的?
- c++ - 是否有任何定义如何在编译时评估浮点值?
- r - 如何删除 x 轴之间的额外空间并绘制 R ggplot 中的 geom_density_ridges_gradient() 图
- python - 如何检查列表是否包含完全匹配的字符串?
- r - R中分位数0.975的数据子集
- javascript - 如何在 Next.js / React 应用程序中加快加载/播放视频的速度?
- firebase - 我用于获取 URL 的 Firebase 云功能导致机器人检测到
- reactjs - 从@material-ui 切换到@mui 主题后未应用