简体   繁体   English

如何使用 Windows Server 2019 在 IIS 10 上托管 Node JS 应用程序

[英]How to host Node JS app on IIS 10 with Windows Server 2019

I have configured all those things which are necessary for iisnode.我已经配置了 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.但是当我通过http://localhost/Backend浏览该站点(后端是托管在 iis 上的站点名称)时,什么也没有发生,页面继续加载。

My web.config:我的 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>

Try to set the Application Pools-> Idle Time-Out to "0" by advance setting and check what is the exact issue.尝试通过预先设置将 Application Pools-> Idle Time-Out 设置为“0”并检查确切的问题。 make sure you installed the iisnode module.确保您安装了 iisnode 模块。

iisnode module indicates that the index.js file is a node.js application to be handled by the iisnode module. iisnode 模块指示 index.js 文件是要由 iisnode 模块处理的 node.js 应用程序。

link:关联:

https://forums.asp.net/t/2145697.aspx?deploy+nodejs+web+api+in+IIS+server 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 https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM