我买了一台新的专用服务器。我有一个 MEAN Stack 应用程序(Node.js、Angular、MongoDB、Express),并且想要利用 IIS 来发布我的 Web 应用程序。
我跟着本指南 http://harveywilliams.net/blog/installing-iisnode安装 iisnode 并使一个小型 Node.js 服务器正常工作。
我做到了并且尝试成功http://iisnode.local http://iisnode.local在我的服务器内的浏览器中。
另一方面,如果我尝试http://(服务器的IP)/iisnode.local http://(theIPoftheserver)/iisnode.local我是否收到以下错误:
我需要做一些事情才能从外部访问服务器,但我不知道做什么..
如果我去http://(服务器的IP)/ http://(theIPoftheserver)/我可以看到 IIS 网站,即使我访问http://(服务器的IP)/节点 http://(theIPoftheserver)/node我可以看到 iisnode 网站...
我是新手,我需要一些帮助......
我的 web.config 文件:
<configuration>
<system.webServer>
<!-- indicates that the server.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
<iisnode enableXFF="true" />
</system.webServer>
</configuration>
编辑:我还必须提到,我在 Windows 的主机文件中有一条新规则,如下所示:
127.0.0.1 iisnode.local
EDIT2:Windows 防火墙可以阻止某些东西吗?我需要断开连接吗?
重要编辑 2016 年 9 月 14 日:如果我编辑主机文件并添加:
<server-ip-address> iisnode.local
然后我就去拜访http://iisnode.local http://iisnode.local有用!
我不太明白为什么......我不希望我网站的所有用户修改他们的主机文件,我该怎么办?
我不知道这是否是问题的根源?
编辑:我的网站绑定如下所示: