How can I use CloudFront access logs to diagnose the root cause of 502 errors?

Responsive Ad Header

Question

Grade: Education Subject: Support
How can I use CloudFront access logs to diagnose the root cause of 502 errors?
Asked by:
78 Viewed 78 Answers

Answer (78)

Best Answer
(416)
CloudFront access logs can be invaluable for diagnosing 502 errors. Look for entries where the `sc-status` (server-to-client status) is 502. Examine the `x-edge-response-result` field to get more detailed information about why the error occurred (e.g., `ORIGIN_TIMEOUT`, `ORIGIN_UNREACHABLE`). You can also correlate these logs with your origin server's logs to pinpoint when the origin stopped responding correctly.