【问题标题】:HTTP Error 500.19 - Internal Server Error after hosting the Angular 4 appHTTP 错误 500.19 - 托管 Angular 4 应用程序后出现内部服务器错误
【发布时间】:2018-05-31 12:41:48
【问题描述】:

我在服务器系统中托管了我的 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>

【问题讨论】:

    标签: angular typescript iis hosting iis-10


    【解决方案1】:

    您的 IIS 缺少 URL 重写模块。

    您可以从 microsoft 下载并安装它:https://www.iis.net/downloads/microsoft/url-rewrite

    【讨论】:

    • 该问题已解决,现在又引发了另一个问题“'Access-Control-Allow-Origin' 标头包含多个值 'localhost, *',但只允许一个值。来源 '@ 987654323@' 因此不允许访问。” @penlechann
    • 这与您的 API 服务器有关。与角度无关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-06
    • 2012-06-15
    • 2012-06-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多