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?

1 Risposta
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
ESPERTO
con risposta 7 mesi fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande