Sudden 502 ERROR? BUt always worked

0

Hi,

I have an AWS Lightsail instance, for a wordpress site. I have a cloudfront distribution (not lightsail), and connected them, and its been working amazingly, haven't had any issues since setting it up.

Today at 1pm local time (UTC), all of a sudden I start getting the 502 errors. I only noticed at around 9 pm, but I checked the 5xx errors and saw that suddenly it happened.

Its strange because I have made no single change, nothing at all. I was not even home and have not been playing with my website, which is STILL ACCESSIBLE VIA IP.

What is causing the issue? My certificates are fine, there is no issue with the instance CPU or memory (ran "top" command).

Any help would be very appreciated

ChrisX
asked 2 months ago79 views
5 Answers
0

Hello.

Have you tried clearing CloudFront's cache?
CloudFront may be caching temporary errors in Lightsail.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#Invalidation_Requests

There may also be other problems on the CloudFront side, so please try the troubleshooting documents below.
https://repost.aws/knowledge-center/cloudfront-502-errors

profile picture
EXPERT
answered 2 months ago
  • thanks for your answer. I have:

    "Date created February 19, 2024 at 1:09:44 AM UTC Status Completed Object paths /* "

    Just cleared cache, but nothing happened. Would there be an issue with cloudfront if things have been working but I made no change at all in months?

    this is strange and frustating, over 5 hours trying to fix now

  • If it has been working until now without changing the CloudFront settings, I feel that the CloudFront settings do not matter much. By the way, is it possible to directly access the origin domain set in CloudFront from a browser? For example, maybe your Lightsail IP address has changed and you can no longer access the domain you set as your origin?

0

Yes I can access the IP address, and directs me to my website no problem. The domain name (obtained from route 53) and the cloudfront url (xxxx.cloudfront.net.) gives me the 502 error

The error happened at 1 pm, when I was not even home or interacting with the website and still persists.

My SSL are good, my cloudfront distribution is on, I literally do not understand what could have happened, it worked always.

My cloudfront origin in xxxx.compute-1.amazonaws.com, I don't know if that can change, I don't even know where to get it from since I set it up with the help of support engineers. But again it should not change

ChrisX
answered 2 months ago
0

I don't understand something. I used online SSL checkers which say I have a valid certificate. But AWS says:

The team kindly asked to to renew the certificate installed on origin "xxxx.compute-1.amazonaws.com" to fix the issue

it states expired as of Feb 18 13:17:01 2024

ChrisX
answered 2 months ago
0

The online SSL checker says:

The certificate should be trusted by all major web browsers (all the correct intermediate certificates are installed).

The certificate will expire in 304 days.

The hostname (example.com) is correctly listed in the certificate.

ChrisX
answered 2 months ago
0

-I have been able to get my website back up. But the process makes me think there is an issue

1: I went to Route 53 and pointed all my domains to my IP address rather than Cloudfront distribution.

2: I then connected to my AWS Lightsail instance and ran "sudo /opt/bitnami/bncert-tool " to renew my certificates.

This would not allow me to run it unless I did step 1. Otherwise, I get a message saying its not pointing to the instance IP address

3: I renewed it, then went to change my A records again to point to cloudfront.

Now this does not make sense. My origin xxxxx-193.compute-1.amazonaws.com, should be using my AMC certificate, which is autorenewed.

When I used Lightsail Distribution I did not have this problem, but now using Cloudfront directly, this comes about. Looks like AWS Lightsail and Cloudfront direct use has an issue.

ChrisX
answered 2 months ago

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