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?

asked 7 months ago270 views
1 Answer
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
EXPERT
answered 7 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions