简体   繁体   中英

Why am I getting Azure Front Doors 400 error

I have a static website set up using an Azure Storage account (blob storage). I want to use Azure Front Doors to handle url rewriting because it's an SPA and always needs to route to index.html in the back end. I've set up a Front Door using the designer. It has one front end (using a subdomain on the azurefd.net domain), one back end, which points to my back end blob storage account and has a matching host header, and one rule which is basically all defaults. I have it set to Match request for HTTP vs HTTPS.

How do you properly configure a Front Door for a static storage site in Azure?

This 400 error can happen if you have not configured a routing rule for the frontend host. A routing rule needs to be explicitly added for that frontend host. Refer to this .

You could get a deep understanding from How Front Door matches requests to a routing rule and check if a valid request path in the routing rule matches the frontend host.

If there isn't a custom forwarding path defined, then the request gets forwarded to the appropriate backend in the configured backend pool as is. Else, the request path is updated as per the custom forwarding path defined and then forward to the backend. You could verify if the forwarded path is valid when you set the custom forwarding path .

在此处输入图片说明

If you have any question, please let me know.

update

For configuring a Front Door for a static storage site in Azure. You could select a custom origin using the static website's URL instead of blob storage origin. Moreover, if you want the URL to be rewritten using a regular expression. You could use Azure CDN for this static website instead of an azure front door. You could override HTTP behavior using the Azure CDN rules engine , so requires the use of the Azure CDN premium offering from Verizon.

More reference: Serving Your Static Sites with Azure Blob and CDN

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