【问题标题】:Angular ABP application not working after being deployed to IIS server, no errors in consoleAngular ABP 应用程序在部署到 IIS 服务器后无法正常工作,控制台中没有错误
【发布时间】:2022-09-14 22:20:33
【问题描述】:

我有使用 ABP 框架构建的 Angular 前端和 .NET 后端。部署后后端工作正常,但前端应用程序只加载 index.html 文件并且不会落后(还有一些 ngx 数据表 css 和其他一些 css 东西)。

另外,我在控制台中没有任何错误。

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

</configuration>

请注意,它在开发中运行良好。

我使用ng build 构建它并将所有文件复制到inetpub/www 文件夹。

【问题讨论】:

标签: .net angular iis deployment abp


【解决方案1】:

尝试这个

<action type="Rewrite" url="/" />

【讨论】:

  • 已经试过了,同样的结果
【解决方案2】:

解决了。

问题出在 IdentityServer 中。我创建了 IdentityServer 没有分成不同项目的项目。因此,由于某种原因,部署后无法自动对用户进行身份验证。在对后端和前端的配置进行了一些更改后,我将其直接添加到数据库中,现在它可以工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-08
    • 1970-01-01
    • 1970-01-01
    • 2019-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    相关资源
    最近更新 更多