cloudfront CloudFront geographic restrictions 如何显示错误页面,而不是简单的报错。

0

cloudfront CloudFront geographic restrictions 如何显示错误页面,而不是简单的报错。

caesar
gefragt vor 5 Monaten209 Aufrufe
1 Antwort
1

目前 CloudFront 可以设定 Custom Error Page[1],例如你可以定义 403 错误指定一个路径的内容显示。 其中当请求被 CloudFront GeoRestriction 阻挡时,也适用 Custom Error Page 的功能,你可以让他显示另外一个路径的错误画面。

请留意这个功能只能针对 Error Code 做页面的复写,当你配置这个功能之后,所有的 403 错误都会显示一样的自订义错误画面。如果你只希望 GeoRestriction 的 403 有自定义的画面,您需要考虑使用 WAF Geo match rule 的功能[2] 搭配 WAF 的自订义响应页面 [3] 达成。

希望这个资讯对你有帮助。

[1] https://docs.aws.amazon.com/zh_cn/AmazonCloudFront/latest/DeveloperGuide/GeneratingCustomErrorResponses.html#creating-custom-error-pages

[2] https://docs.aws.amazon.com/zh_cn/waf/latest/developerguide/waf-rule-statement-type-geo-match.html

[3] https://docs.aws.amazon.com/zh_cn/waf/latest/developerguide/waf-custom-request-response.html

profile picture
beantwortet vor 4 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen

Relevanter Inhalt