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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南