Home > OS >  HTTP ERROR 400.605. Deploying NodeJS app on IIS
HTTP ERROR 400.605. Deploying NodeJS app on IIS

Time:02-17

I've got error during deploying my app to IIS Server. I use URL Rewrite and IISNode. I gave all permissions to IUSR and IIS_IUSRS, and I went throught a lot of errors, but I can't go through this one. I will be very grateful for your help.

I've got this error

My web.config file looks like:

    <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>

My app.js file looks like:

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')
});

CodePudding user response:

From the analysis of the error information, it can be determined that the problem is caused by the abnormal request of the ARR module, mainly because of the syntax error of the URL rewriting rule, which will cause this 400.605 error. It is recommended to use the exclusion method, first disable all ARR rules, and then gradually sort out the rules with grammar problems.

Here is the same question you can use as a reference: 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.

  • Related