【问题标题】:how to deploy node.js app in iis virtual directory如何在 iis 虚拟目录中部署 node.js 应用程序
【发布时间】:2020-10-09 15:42:49
【问题描述】:

我找到了一种使用 iisnode 和 urlrewrite 在 iis 路由中部署节点应用程序的方法。 它工作得很好。任何人都可以帮助解决这个问题。

【问题讨论】:

标签: node.js iis nuxt.js iisnode


【解决方案1】:

尝试使用带有 href 的 ng build 命令并使用虚拟目录名称的值。

低于 URL 重写规则:

<rule name="StaticContent" patternSyntax="Wildcard">
                <action type="Rewrite" url="public/{R:0}" logRewrittenUrl="true"/>
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                </conditions>
                <match url="*.*"/>
            </rule>

          
            <rule name="DynamicContent">
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
                </conditions>
                <action type="Rewrite" url="server.js"/>
            </rule>
            <rule name="SocketIO" patternSyntax="ECMAScript">
                <match url="socket.io.+"/>
                <action type="Rewrite" url="server.js"/>
            </rule>

确保已安装 iisnode 模块。

IIS, Node.js, and Web Application with IISNode not configured right with Virtual Directory

Running nodejs/MEAN app on IIS virtual directory setup

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 2012-10-26
    • 1970-01-01
    • 2010-10-11
    相关资源
    最近更新 更多