简体   繁体   English

为什么我收到 Azure Front Doors 400 错误

[英]Why am I getting Azure Front Doors 400 error

I have a static website set up using an Azure Storage account (blob storage).我有一个使用 Azure 存储帐户(blob 存储)设置的静态网站。 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.我想使用 Azure Front Doors 来处理 url 重写,因为它是一个 SPA 并且总是需要路由到后端的 index.html。 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.它有一个前端(使用 azurefd.net 域上的子域),一个后端,指向我的后端 blob 存储帐户并具有匹配的主机标头,以及一个基本上所有默认值的规则。 I have it set to Match request for HTTP vs HTTPS.我将它设置为匹配 HTTP 与 HTTPS 的请求。

How do you properly configure a Front Door for a static storage site in Azure?如何为 Azure 中的静态存储站点正确配置 Front Door?

This 400 error can happen if you have not configured a routing rule for the frontend host.如果您尚未为前端主机配置路由规则,则可能会发生此 400 错误。 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.您可以深入了解Front Door 如何将请求与路由规则匹配,并检查路由规则中的有效请求路径是否与前端主机匹配。

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 .您可以在设置custom forwarding path时验证forwarded path是否有效。

在此处输入图片说明

If you have any question, please let me know.如果您有任何问题,请告诉我。

update更新

For configuring a Front Door for a static storage site in Azure.用于为 Azure 中的静态存储站点配置 Front Door。 You could select a custom origin using the static website's URL instead of blob storage origin.您可以使用静态网站的 URL 而不是 Blob 存储源来选择custom origin源。 Moreover, if you want the URL to be rewritten using a regular expression.此外,如果您希望使用正则表达式重写 URL。 You could use Azure CDN for this static website instead of an azure front door.您可以将Azure CDN 用于此静态网站,而不是天蓝色的前门。 You could override HTTP behavior using the Azure CDN rules engine , so requires the use of the Azure CDN premium offering from Verizon.您可以使用 Azure CDN 规则引擎覆盖 HTTP 行为,因此需要使用来自 Verizon 的 Azure CDN 高级产品。

More reference: Serving Your Static Sites with Azure Blob and CDN更多参考: 使用 Azure Blob 和 CDN 为您的静态站点提供服务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在Chrome中收到400错误的印前检查要求,并且遇到了错误。 Angular + Azure函数 - I am getting and error in chrome as 400 bad request for preflight. Angular + Azure Functions 为什么我会收到此错误“Azure 错误:InvalidTemplateDeployment”? - Why am I getting this error “Azure Error: InvalidTemplateDeployment”? 为什么在 Azure SignalR 上调用通知时出现连接错误 - Why am I getting connection error on calling notify on Azure SignalR 连接到Text Analytics API时,为什么会收到(400)错误的请求错误? - Why am I getting (400) Bad Request error when connecting to Text Analytics API? 为什么使用 Azure 图表 SDK 收到 400 错误请求? - Why I'm getting 400 Bad Request with Azure Graph SDK? 为什么我从 azure sql 收到此错误? 错误代码 [70527] - Why am I getting this error from azure sql? Error Code [70527] 我收到关于模拟和REAL Azure存储的错误请求(400)消息 - I am getting Bad Request (400) messages for Emulated and REAL Azure storage 为什么我在Azure上的代码隐藏出现404错误? - Why am I getting a 404 error for my code-behind on Azure? 为什么我收到错误 2005 - 无法使用 Azure 表单识别器读取文件? - Why am I getting error 2005 - unable to read file using Azure Form Recognizer? 为什么在使用 pip 安装 Azure-CLI 时出现错误 - why i am getting error while installing Azure-CLI using pip
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM