angular - Azure CDN - 与 Verizon 结合 Identity Server 4 重写 Angular 应用程序的 URL

标签 angular azure identityserver4 azure-cdn azure-storage-account

上下文

<小时/>

我正在尝试使用 Azure CDN 结合 Verizon 来设置我的 Angular 项目,以进行实际的 URL 重写。

已使用专用的Blob 容器设置存储帐户

enter image description here

并且CDN-Profile已配置为使用它。

enter image description here

我想做的是重定向所有传入流量,以便 Angular 可以毫无问题地工作。

为此,我使用 following两个路由引擎规则:

enter image description here

这工作得很好,但该模式不支持 Identity Server 4 的重定向实现。

问题

<小时/>

Identity Server 4 配置为重定向到 following url (pastebin url) 身份验证成功后。

重定向后,我当前收到 http 404 错误。

如果我只使用以下网址,我也会遇到同样的错误:

https://MyFancyWebsite.azureedge.net/security/callback

enter image description here

我不介意自己创建正则表达式模式,但说实话,我什至不知道最终的 URL 应该是什么样子,以便 Angular 可以使用它。

我想补充一点,当前的实现在我的本地计算机上没有任何问题。

最佳答案

根据我的理解,您需要修改规则引擎下的源模式以捕获 # .

对于第一个源模式,您可以使用 ((?:[^\?]*/)?)($|[\?#].*) ,对于第二个源模式,您可以使用 ((?:[^\?]*/)?[^\?/.]+)($|[\?#].*) 。这是第二个模式的测试:

enter image description here

此外,您还可以使用 https://regex101.com 下的正则表达式来检查 url。并确保相关的 blob 存在。例如,https://<your-storage-account-name>.blob.core.windows.net/cdn/security/callback/index.html .

关于angular - Azure CDN - 与 Verizon 结合 Identity Server 4 重写 Angular 应用程序的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49370216/

相关文章:

javascript - 如何在 index.html angular 8 中使用 *ngIf

c# - Identityserver 4 和 Ocelot

angular - 将 JWT token 存储到 HttpOnly cookie 中

angular - 请添加@Pipe/@Directive/@Component注解IONIC 3

angular - typescript 以循环方式将元素插入数组

angular - 是否可以添加动态类以在 Angular 2 中托管?

azure - 停止应用程序洞察

Azure SSO 无法通过访问 token 获取用户信息

azure - Azure Functions 可以与 URI 路径 ID 一起使用吗?

c# - Identity Server 4 从 UI 进行身份验证后添加声明