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

0

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

caesar
preguntada hace 5 meses209 visualizaciones
1 Respuesta
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
respondido hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas