iisnode helloworld错误HTTP状态:500

时间:2019-01-30 13:07:26

标签: node.js iis iisnode

我开始使用我用nodejs构建的非常简单的API进行工作,并且它在Visual Studio IIS Express中运行正常,没有任何问题。 当我尝试将其移至iis时,我安装了最新版本的iisnode并继续执行所有步骤以使内置示例正常运行,但没办法!

  • 我安装了URL重写
  • 为具有身份本地系统的节点应用创建特定的池
  • 授予iis用户对应用程序文件夹及其所有子文件夹的完全控制权限
  • 同时赋予池完全控制权
  • 确保iisnode执行nodejs.exe文件而不是符号链接
  • 确保我的iis安装了Web套接字扩展
  • 使用默认的Web配置文件
  • 重新启动IIS甚至机器 我认为这是我从许多教程中获得的所有内容,但从未使它起作用 错误: enter image description here hello.js代码

    var http = require('http');

    http.createServer(function(req,res){     res.writeHead(200,{'Content-Type':'text / html'});     res.end('Hello,world![helloworld示例; iisnode版本为'+ process.env.IISNODE_VERSION +',节点版本为'+ process.version +']')); })。listen(process.env.PORT);

    web.config代码

      

    <!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module -->
    
    <handlers>
      <add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
    </handlers>
        <rewrite>
            <rules>
                <rule name="ALLURL">
                    <match url="/*" />
                    <action type="Rewrite" url="hello.js" />
                </rule>
            </rules>
        </rewrite>
    

  • /hello.js/debug不能很好地保持加载状态,它比在控制台中显示约125条错误消息,提示无法加载js文件

任何使它起作用的帮助将受到高度赞赏,我知道该节点可以自我托管该应用程序,但是它必须在iis上运行。

0 个答案:

没有答案
相关问题