Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 为什么';t Nodejs应用程序在Windows IIS上工作_Node.js_Iisnode - Fatal编程技术网

Node.js 为什么';t Nodejs应用程序在Windows IIS上工作

Node.js 为什么';t Nodejs应用程序在Windows IIS上工作,node.js,iisnode,Node.js,Iisnode,我将nodejs应用程序与要在windows IIS上托管的express一起使用。在我的IIS8中nodej起作用了。但是我得到了一个错误'Cannot GET/node/server.js',我将重写规则放在web.config中。然后我得到了以下错误 HTTP错误500.19-内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效 我在网上发现的。每个人都建议使用以下配置,但在我的windows上不起作用 我的web.config文件是: <configuration>

我将nodejs应用程序与要在windows IIS上托管的express一起使用。在我的IIS8中nodej起作用了。但是我得到了一个错误'Cannot GET/node/server.js',我将重写规则放在web.config中。然后我得到了以下错误

HTTP错误500.19-内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效

我在网上发现的。每个人都建议使用以下配置,但在我的windows上不起作用

我的web.config文件是:

<configuration>
  <system.webServer>
<handlers>
  <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<defaultDocument>
  <files>
    <add value="server.js" />
  </files>
</defaultDocument>
<rewrite>
  <rules>
    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$"/>
    </rule>
    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^server.js\/debug[\/]?" />
    </rule>
    <rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
    </rule>
    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
      </conditions>
      <action type="Rewrite" url="server.js"/>
    </rule>
  </rules>
</rewrite>
<iisnode nodeProcessCountPerApplication="8" watchedFiles="*.js;node_modules\*;routes\*.js;views\*.html"/> 
</system.webServer> 
</configuration>

有什么建议吗?
谢谢

您的配置文件看起来有效。所以,你必须安装它,它工作得很好