2

I have configured all those things which are necessary for iisnode. But when i browse the site through http://localhost/Backend (Backend is a site name hosted on iis) then nothing is being happened and page keeps loading.

My web.config:

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
        <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
    </handlers>
    <rewrite>
        <rules>
                <rule name="nodejs">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern="" ignoreCase="true" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/index.js" />
                </rule>
        </rules>
    </rewrite>
    <security>
    <requestFiltering>
        <hiddenSegments>
            <add segment="node_modules" />
        <add segment="iisnode" />
        </hiddenSegments>
    </requestFiltering>
    </security>
    </system.webServer>
</configuration>
Asif Hussain
  • 93
  • 2
  • 3
  • 12
  • try to set the Application Pools-> Idle Time-Out to "0" by advance setting and check what is the exact issue. make sure you installed the iisnode module. https://forums.asp.net/t/2145697.aspx?deploy+nodejs+web+api+in+IIS+server – Jalpa Panchal Apr 14 '20 at 02:39
  • Thanks for your response. After setting the Idle Time-Out to "0" i found my issue. Actually my web.config Rewrite rule not pointing to the exact location where my node js app was running. After replace this line to then it is working fine. But i am not be able to understand what is the use of iisnode. When i removed this line it is also working. – Asif Hussain Apr 14 '20 at 07:40
  • I posted the solutions please mark it as an answer it will help other people who face a similar issue. – Jalpa Panchal Apr 14 '20 at 08:19
  • 1
    Did you install IISNode for IIS v10 on Windows Server 2019? If so can you please let me know the location for IISNode download – Rajesh Jul 14 '20 at 09:39

1 Answers1

0

Try to set the Application Pools-> Idle Time-Out to "0" by advance setting and check what is the exact issue. make sure you installed the iisnode module.

iisnode module indicates that the index.js file is a node.js application to be handled by the iisnode module.

link:

https://forums.asp.net/t/2145697.aspx?deploy+nodejs+web+api+in+IIS+server

https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26