简体   繁体   中英

Azure CDN - Rewriting Url for Angular Application with Verizon in combination with Identity Server 4

Context


I am trying to setup my Angular project using Azure CDN in combination with Verizon to do the actual URL rewritting.

The storage account has been set up with a dedicated blob container .

在此处输入图片说明

and the CDN-Profile has been configured to make use of it.

在此处输入图片说明

What I would like to do is to redirect all incoming traffic so that Angular can work without any issues.

For that I use the following two route engine rules:

在此处输入图片说明

This works quite well but the pattern doesn't support the redirect implementation of Identity Server 4 .

Problem


Identity Server 4 is configured to redirect to the following url (pastebin url) after a successful authentication.

After the redirect I currently get an http 404 error.

I also get the same error if I just use the following url:

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

在此处输入图片说明

I don't mind creating the regex pattern by myself but to be honest I don't even know what the final URL should look like, so that Angular can work with it.

I would like to add that the current implementation works without any issues on my local machine.

Per my understanding, you need to modify your source pattern under Rules Engine to capture the # .

For the first source pattern, you could use ((?:[^\\?]*/)?)($|[\\?#].*) , for the second source pattern, you could use ((?:[^\\?]*/)?[^\\?/.]+)($|[\\?#].*) . Here is the test for the second pattern:

在此处输入图片说明

Moreover, you could check the url with the regular expression under https://regex101.com and make sure the related blob exists. For example, https://<your-storage-account-name>.blob.core.windows.net/cdn/security/callback/index.html .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM