在 IIS 中托管 angular 4 应用程序后 HTTP 错误 500.19 内部服务器错误

Nik*_*son 0 web-config typescript angular

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

图片 :

在此处输入图片说明

网页配置

 <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>
Run Code Online (Sandbox Code Playgroud)

索引.html

<base href ="/eCommerceWebsite/">
Run Code Online (Sandbox Code Playgroud)

IIS 中的物理路径

C:\eCommerceWebsite
Run Code Online (Sandbox Code Playgroud)

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

编辑 :

图1:

在此处输入图片说明

图 2:

在此处输入图片说明

更新了 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>
Run Code Online (Sandbox Code Playgroud)

编辑2:

在此处输入图片说明

Mar*_*sta 5

只是为了保持注册在这里。您需要安装IIS URL Rewrite,这是您的 < rewrite > 路由工作的 IIS 扩展。这个扩展解决了我的 IIS 问题。