I tried to configure a redirect rule on a CDN Standard Microsoft endpoint, and I would add the SAS token to all the requests forwarded to a specific URI but I couldn't add a redirect rule with regexp like "/test(.*)".
I noticed into the documentation that the regexp redirect are available only on Premium Verizon.
Is it possible to configure on CDN Standard Microsoft a regexp redirect?
Thanks,
Marcello
Currently Microsoft CDN Standard does not support a wild card regex redirect, as mentioned by you the option is only available on Azure CDN Premium from Verizon. Please refer to this documentation for any additional details.
Related
I have followed this link to convert all the HTTP endpoints to HTTPS.
However, it uses an option called
IF Request Protocol;
THEN
URL Redirect
Request Protocol is not available(I cannot see) in the CDN profile that I am trying to configure. I have attached a screenshot of the rule creation phase below.
Question 1
Where can I find the Request Protocol option on the CDN Config page?
Question 2
If Request Protocol is deprecated(or no longer available), how can I perform the mentioned task?
The rules engine that's described in that article is available only for Standard Azure CDN from Microsoft.
To redirect HTTP to HTTPS in Azure Premium Verizon CDN, you can follow the steps in this blog.
The rules can take up to 4 hours to become active. But it’s typically much faster.
I use Static website feature of Azure storage account to host React.js application. There is also a CDN endpoint enable for the site (Microsoft Standard CDN pricing tier), so the site URL looks like https://xxx.azureedge.net/. The problem: when I try to access the site via HTTP protocol, it says:
The account being accessed does not support http.
HttpStatusCode: 400
ErrorCode: AccountRequiresHttps
RequestId : 46959fc9-a01e-006d-2bc5-6b781e000000
TimeStamp : 2020-08-06T07:48:01.6590412Z
I would like the user to be redirected to HTTPS version.
You can allow HTTP without CDN:
Under "Settings"->"Configuration" set "Secure tranfer required" to "Disabled".
However, for redirecting to HTTPS you need for example CDN.
The solution was found in Microsoft documentation https://learn.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine#redirect-users-to-https
It says that the redirection from HTTP to HTTPS can be configured in the Rules engine of CDN endpoint.
It makes sense to keep in mind that:
the rules will not be applied immediately, in my case it started to work in 10 minutes.
the Rules engine is available for Standard Microsoft and Premium Verizon.
I have now successfully setup my static website in a CDN,
Is there a way to specify that index.html is the default document ?
It is a 1 page site I just would like to browse to the root url without having to type /index.html ..
Thank you
Based on your previous question, I am assuming that you have set CDN to map to blob storage. If this is correct, unfortunately it is not possible as of today because Azure Storage does not have a support for default document. This is one of the most requested feature on Azure Feedback - https://feedback.azure.com/forums/217298-storage/suggestions/1180039-support-a-default-blob-for-blob-storage-containers however it is still pending.
If you want, you can create a proper website (instead of having this index.html file in blob storage) and serve that website via CDN. You can find more details about it here: https://azure.microsoft.com/en-in/documentation/articles/cdn-websites-with-cdn/.
Microsoft is working on this. At the moment you have only two possibilities to solve this:
Use CDN: With the premium version of Verizon you can create rules like Redirect Rules
Create an Web-App which act as a proxy and serves/redirects (to) blobs
Using Premium CDN
If you purchased the premium version of Verizon CDN then you can create custom Rewrite rules. You'll find this in the "Advanced Features" section of your CDN endpoint. Once you click on "Manage" you will be redirected outside the portal where you can manage your cdn.
Hier you must create a redirect rule like this:
Note that each change in a rule takes about 5 hours to be activated.
To check if your redirect rule works you can install IIS and activate the URL Rewrite Module. In the Rewrite Module you can test your rules.
Open IIS
Open Url Rewrite Module
Add Rule
Add blank rule
Test Pattern
Please note that if you test your pattern, it must begin with the CDN source path which is a number and your endpointname like /829292/movies.
Sometimes redirect rules causes problems with CDN Purging. You can solve this isssue by adding an if clause in your rule which says that redirect should only be active if it is not the purge agent.
This is now possible with Static websites on Azure Storage
Creating a Static Website
Navigate to your storage account
Select Static Website from the blade and toggle to "enabled"
Once you save, this will create a URL endpoint and also a bucket named $web to host your files
Go to your $web storage container and upload any files you want
Add CDN / Custom Domain
Navigate to your CDN Profile and either Create / Edit your Endpoint
Select 'Custom Origin' and use the 'Origin Hostname' that was created for your static site
Give Azure up to 30 minutes to propagate all the settings
Further Reading
Tutorial: Host a static website on Blob Storage
Tutorial: Use Azure CDN to enable a custom domain with SSL for a static website
I have now successfully setup my static website in a CDN,
Is there a way to specify that index.html is the default document ?
It is a 1 page site I just would like to browse to the root url without having to type /index.html ..
Thank you
Based on your previous question, I am assuming that you have set CDN to map to blob storage. If this is correct, unfortunately it is not possible as of today because Azure Storage does not have a support for default document. This is one of the most requested feature on Azure Feedback - https://feedback.azure.com/forums/217298-storage/suggestions/1180039-support-a-default-blob-for-blob-storage-containers however it is still pending.
If you want, you can create a proper website (instead of having this index.html file in blob storage) and serve that website via CDN. You can find more details about it here: https://azure.microsoft.com/en-in/documentation/articles/cdn-websites-with-cdn/.
Microsoft is working on this. At the moment you have only two possibilities to solve this:
Use CDN: With the premium version of Verizon you can create rules like Redirect Rules
Create an Web-App which act as a proxy and serves/redirects (to) blobs
Using Premium CDN
If you purchased the premium version of Verizon CDN then you can create custom Rewrite rules. You'll find this in the "Advanced Features" section of your CDN endpoint. Once you click on "Manage" you will be redirected outside the portal where you can manage your cdn.
Hier you must create a redirect rule like this:
Note that each change in a rule takes about 5 hours to be activated.
To check if your redirect rule works you can install IIS and activate the URL Rewrite Module. In the Rewrite Module you can test your rules.
Open IIS
Open Url Rewrite Module
Add Rule
Add blank rule
Test Pattern
Please note that if you test your pattern, it must begin with the CDN source path which is a number and your endpointname like /829292/movies.
Sometimes redirect rules causes problems with CDN Purging. You can solve this isssue by adding an if clause in your rule which says that redirect should only be active if it is not the purge agent.
This is now possible with Static websites on Azure Storage
Creating a Static Website
Navigate to your storage account
Select Static Website from the blade and toggle to "enabled"
Once you save, this will create a URL endpoint and also a bucket named $web to host your files
Go to your $web storage container and upload any files you want
Add CDN / Custom Domain
Navigate to your CDN Profile and either Create / Edit your Endpoint
Select 'Custom Origin' and use the 'Origin Hostname' that was created for your static site
Give Azure up to 30 minutes to propagate all the settings
Further Reading
Tutorial: Host a static website on Blob Storage
Tutorial: Use Azure CDN to enable a custom domain with SSL for a static website
As mentioned in the title above I have a cloudservice with a WebRole that runs a web app www.myappname.com. I have taken all necessary steps to enable serving of CDN content from my app using url rewrite module on IIS. This works fine but:
The requests coming in from CDN are forwarded to .cloudapp.net instead of my custom hostname binding. I cannot find any place to change this in my configuration. When I create a new CDN endpoint my options for setting the ORIGIN DOMAIN are limited to my cloud service endpoints
Say I got a custom domain name for my cloud service CDN endpoint (ex. static.appnamecdn.com). What happens when I make request with https? I don't see any place to register the "static.appnamecdn.com" 's ssl certificate. Isn't something like this required?
From the help icon on the Create CDN Endpoint screen (Azure Management Portal) I got my answer to the second point above:
If you choose to enable HTTPS for your CDN endpoint, keep in mind the
following points:
You must use the certificate provided by the CDN. Third party certificates are not supported.
You must use the CDN domain to access content. HTTPS support is not available for custom domain names (CNAMEs) since the CDN does
not support custom certificates at this time.
HTTPS is from the CDN to the client only. Requests from the CDN to the content provider (Storage Account or hosted service) are
still made using HTTP.
Regarding your first question, I don't think that is possible...Azure's CDN unfortunately is somewhat limited in its options.
As to the 2nd, as was said in the other answer, it's not possible to use HTTPS with a custom domain name :/