angular - HTTP 错误 500.19 - 托管 Angular 4 应用程序后出现内部服务器错误

标签 angular typescript iis hosting iis-10

我在服务器系统中托管了我的 Angular 4 应用程序,最初我收到 404 错误所以我在我的生产构建文件夹中添加了一个 web.config 文件。现在我收到了这个错误。

但该应用程序在我的本地系统上运行良好,它在服务器系统上抛出错误。我尝试了一些在 win7、win10 上运行的其他系统,但它没有运行,总是显示 500.19 的错误。

我花了几个小时来解决这个问题,引用了 stackoverflow 中与我的帖子相关的所有帖子,但没有任何效果。

谁能帮我解决这个问题。

错误页面:

enter image description here

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/

相关文章:

angular - 通过更改 .filteredData 属性更新垫表内容

angular - Angular 中(单击)的样式绑定(bind)

angular - 无法解析 [...] 的所有参数

asp.net - 用于从经过身份验证的端点下载大文件的跨浏览器解决方案

webstorm 10.0.2 中的 typescript 1.5 beta,出现错误 : TS2304-Cannot find name 'DataView'

css - Angular - 将自定义CSS应用于无效的FormControl,而不是FormGroup?

asp.net-mvc - 将 httpLogging 设置添加到 MVC web.config 时出现 HTTP 错误 500

typescript - 如何在没有模块加载系统的情况下将我的 Typescript 编译成单个 JS 文件?

asp.net - 在 IIS 中,为什么窗口身份验证没有显示为我的 Web 应用程序的选项之一?

访问虚拟文件夹时出现 IIS 7 500 错误