How do I prevent CloudFront from caching for a specific User Agent? (Zabbix web monitoring)

0

I configured Zabbix web scenarios for monitoring WordPress sites. The problem is that CloudFront caches it and returns HTTP code 200 without reffering to the origin. To solve this, I came up with an idea that I might be able to disable caching for a specific User Agent by using Lambda@Edge or CloudFront functions or something, but I'm not sure about it. Is there any common solution or best practice in the case like this?

已提问 7 个月前284 查看次数
1 回答
0

Hi,

There is a simpler solution to your problem, I believe: do not query the URL served by CloudFront from Zabbix but rather directly query the DNS name of the origin that you refer to in the CloudFront distribution.

You can of course continue polling the CloudFront URL in parallel to monitor the health of CloudFront itself.

Best,

Didier

profile pictureAWS
专家
已回答 7 个月前
  • Thanks, but unfortunately I need to use actual domain names because the origin (ALB + EC2) uses name-based virtualhost settings to host multiple websites. I need to come up with some workaround for this.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则