在 IIS 中托管 angular 4 应用程序后 HTTP 错误 500.19 内部服务器错误 [英] HTTP Error 500.19 Internal Server Error after hosting angular 4 application in IIS

查看:29
本文介绍了在 IIS 中托管 angular 4 应用程序后 HTTP 错误 500.19 内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我不是第一个在这里问这个问题的人,我可以找到很多与我的问题相关的解决方案,但没有解决我的问题.,

I know I am not the first to ask this question here ,I could find lot of solutions related to my issue but nothing is solved my issue .,

图片:

Web.config

 <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="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>

index.html

<base href ="/eCommerceWebsite/">

IIS 中的物理路径

C:\eCommerceWebsite

谁能告诉我我在哪里犯了错误以及我需要在这里更改什么

Can anyone tell me where I did the mistakes and what I need to change here

图像 1:

图片 2:

更新了 web.config

Updated web.config

    <?xml version="1.0" encoding="UTF-8"?>
    <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>

编辑 2 :

推荐答案

只是为了保持注册在这里.您需要安装 IIS URL Rewrite,这是您的 < 的 IIS 扩展;rewrite> 路线有效.这个扩展解决了我的 IIS 问题.

Just to keep in register here. You need to install the IIS URL Rewrite, this is an IIS Extension to your <rewrite> routes works. This extension fixed my problem with IIS.

这篇关于在 IIS 中托管 angular 4 应用程序后 HTTP 错误 500.19 内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆