Welcome! Log In Create A New Profile

Advanced

Cloudfront 502 Errors with Nginx

Posted by neodjandre2 
Cloudfront 502 Errors with Nginx
May 01, 2023 07:56AM
We are using this Nginx Configuration:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 10s;

We have a wordpress site and are getting random 502 errors with Amazon Cloudfront on our images which are interpreted as html files for some reason.

These errors appear random and only happen with a low number of images, but still considerable to break the user experience.

We do not even know how to troubleshoot this...

Summary
URL: https://cdn.example.com/wp-content/uploads/2022/07/Tsimi-300x300.jpg
Status: 502
Source: Network
Address: xx:xx:xx:xx:1d:xx:18c0:xx:xx
Initiator:
lazyload.min.js:1:5136


Request
:method: GET
:scheme: https
:authority: cdn.example.com
:path: /wp-content/uploads/2022/07/Tsimi-300x300.jpg
Cookie: _ga=GA1.1.337641553.1682xxx518; _ga_NS1VYLWN5N=GS1.1.16xxx35123.8.1.168xxx39467.0.0.0; _ga_RMTVXMLDJX=GS1.1.16xxx35124.1.1.168xxx9467.0.0.0; _gid=GA1.2.247650269.168xxx5518; _gat_gtag_UA_165302811_1=1
Accept: image/webp,image/avif,video/*;q=0.8,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5
Accept-Encoding: gzip, deflate, br
Host: cdn.example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15
Accept-Language: en-GB,en;q=0.9
Referer: https://www.example.com/restaurants/manhat/
Connection: keep-alive

Response
:status: 502
Content-Type: text/html
Via: 1.1 xxxx.cloudfront.net (CloudFront)
Date: Mon, 01 May 2023 11:11:08 GMT
Content-Length: 1033
x-cache: Error from cloudfront
Server: CloudFront
x-amz-cf-pop: LHR61-P2
x-amz-cf-id: b0ppiXw7R2H7BAbDJx9v-xOE7bmSFx1RCa1aCxN5W_eGZRKuNjzIfw==


any help is much appreciated

Andrew
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready