我在服务器系统中托管了我的 Angular 4 应用程序,最初我收到 404 错误所以我在我的生产构建文件夹中添加了一个 web.config 文件。现在我收到了这个错误。
但该应用程序在我的本地系统上运行良好,它在服务器系统上抛出错误。我尝试了一些在 win7、win10 上运行的其他系统,但它没有运行,总是显示 500.19 的错误。
我花了几个小时来解决这个问题,引用了 stackoverflow 中与我的帖子相关的所有帖子,但没有任何效果。
谁能帮我解决这个问题。
错误页面:
Web.Config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/eCommerceWebsite" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
最佳答案
您的 IIS 缺少 URL 重写模块。
您可以从 Microsoft 下载并安装它:https://www.iis.net/downloads/microsoft/url-rewrite
关于angular - HTTP 错误 500.19 - 托管 Angular 4 应用程序后出现内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50616416/