angular - 错误 HTTP 500.19 - 在 IIS 中部署 Angular 应用程序时出现内部服务器错误

标签 angular iis deployment web-deployment http-status-code-500

我在 IIS 上部署 Angular 应用程序时遇到问题,我添加了配置文件“web.config”,并向用户授予了权限:

<?xml version = "1.0" encoding = "UTF-8" ?>
<configuration>
    <system.webServer>
      <rewrite>
        <rules>
          <rule name="Angular Routes" stopProcessing="true">
            <match url=".*" />
            <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="/" />
          </rule>
        </rules>
      </rewrite>
    </system.webServer>
</configuration>

但我不断收到此错误: enter image description here

如果我删除 web.config 文件,它可以工作但不完全,我仍然会在 Api 调用和重新加载页面时收到 404 错误。

此处编辑:

其他信息:

这是我在删除 we.config 时遇到的严重 404 错误:

enter image description here

enter image description here

这是app.config.json:

{
  "apiUrl": "my_back_end_deplyment_Url",
  "dashboardUrl": "/",
  "theme": "theme-green",
  "notificationRefreshInterval": 900000,
  "maxNotificationToTake": 10,
  "useNotifications": false,
  "useDashboard": false,
  "intervalConnectionCheck": 300000
}

我是否搞乱了其他东西(也许是将 Angular 应用程序链接到我的 .NET Core 应用程序)?

最佳答案

看起来 UrlReWrite对于这个过程是必要的,由于公司的限制(安全问题),我一开始无法安装它。安装后就可以正常使用了。

关于angular - 错误 HTTP 500.19 - 在 IIS 中部署 Angular 应用程序时出现内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68951170/

相关文章:

angular - jasmine-karma 中的模块 'undefined' 导入了意外值 'DynamicTestModule'

javascript - Angular2 setinterval 在 dom 更改时被阻止

asp.net - IIS - 需要特定 MVC Controller 的 SSL 客户端证书

c++ - Isapi 过滤器到 apache 模块

c# - 在 ASP.NET 中上传大文件时如何减少服务器内存使用?

c# - ClickOnce 部署留下多个版本(是的,不止两个)

deployment - 创建多个 Nuspec 文件

css - 使用 Angular 8 + Tailwind.css + LESS 进行缓慢的 Webpack 编译

c# - 有没有一种灵活的方式来部署我的 silverlight 应用程序并以编程方式更改设置?

Angular 5 - 将服务限制为模块