【问题标题】:HTTP ERROR 400.605. Deploying NodeJS app on IISHTTP 错误 400.605。在 IIS 上部署 NodeJS 应用程序
【发布时间】:2022-02-17 10:24:23
【问题描述】:

在将我的应用程序部署到 IIS 服务器时出错。我使用 URL 重写和 IISNode。我将所有权限授予了 IUSR 和 IIS_IUSRS,我遇到了很多错误,但我无法通过这个。我将非常感谢您的帮助。

I've got this error

我的 web.config 文件如下所示:

    <configuration>
   <system.webServer>
     <handlers>
       <add name="iisnode" path="src/app.js" verb="*" modules="iisnode" />
     </handlers>
     <rewrite>
       <rules>
         <rule name="app">
           <match url="/*" />
           <action type="Rewrite" url="src/app.js" />
         </rule>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:8080/{R:1}" />
                </rule>
       </rules>
     </rewrite>
     
     <security>
       <requestFiltering>
         <hiddenSegments>
           <add segment="node_modules" />
         </hiddenSegments>
       </requestFiltering>
     </security>    
     
   </system.webServer>
 </configuration>

我的 app.js 文件如下所示:

const express = require('express');
const cors = require('cors');

const app = express();

app.get('/', (req, res, status)=>{
    return res.status(200).json({
        "message": "Hello world!"
    });
});

app.use(cors());
app.use(express.json());

app.listen(8080, () => {
  console.log('App listening on port 8080')
});

【问题讨论】:

    标签: node.js express iis deployment windows-server-2019


    【解决方案1】:

    通过对错误信息的分析,可以确定问题是ARR模块的异常请求引起的,主要是URL重写规则的语法错误,会导致这个400.605错误。建议使用排除法,先禁用所有的ARR规则,再逐步梳理出语法有问题的规则。

    您可以参考以下问题:ARR The request cannot be routed because it has reached the Max-Forwards limit. The server may be self-referencing itself in request routing topology

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-09
      • 1970-01-01
      • 2022-01-07
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多