将Angular Universal部署到IIS [英] Deploy Angular Universal to IIS
本文介绍了将Angular Universal部署到IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在web.config
中将Node.js部署到IIS时遇到问题:
I am having a problem deploying my Node.js to the IIS, in my web.config
:
> <handlers>
> <add name="iisnode-ng-universal" path="dist/server.js" verb="*" modules="iisnode" />
> </handlers>
<rule name="ng-universal" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{HTTP_HOST}" pattern="test" />
</conditions>
<action type="Rewrite" url="dist/server.js" />
</rule>
我收到此错误:
这是我的网络文件树的外观:
This how my web files tree looks:
我试图授予IIS_IUSRS
和IUSR
的完全许可,但是它似乎不起作用.像这样的帖子建议:
iisnode在处理请求时遇到错误
I tried to give full permission to IIS_IUSRS
and IUSR
but it does not seem to work. Like this post suggested:
iisnode encountered an error when processing the request
推荐答案
可以尝试下面的代码..它对我有用
can you try the below code.. it works for me
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<rule name="DynamicContent">
<match url="/*" />
<action type="Rewrite" url="server.js"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
您的server.js可以位于dist文件夹之外.
Your server.js can be outside the dist folder.
这篇关于将Angular Universal部署到IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文