Skip to content

Cloud Front 504 error - The request could not be satisfied

0

Hi all,

Previously my wordpress website was working correctly with ELB, Cloudfront, S3 in AWS. However, it was not working suddenly a few days ago and returns "504 ERROR. The request could not be satisfied."

After that, I created a simple page coming_soon.html and it can be accessed www.example.com/coming_soon.html successfully (using the following behavior) default

However, when i added a new behavior for coming_soon.html, it cannot be displayed and return 504. coming_soon

And I checked the ELB logs, i cannot see any "coming_soon.html" request. It looks like cloudfront drop the request.

Anyone can help? or give me a hits to resolve it?

Thanks Wayne

4 Answers
3

Hello Wayn...!,

504 error in your CloudFront points to an issue with CloudFront reaching WordPress.

  • Check server access: Ensure your WordPress server is reachable publicly (use nc -zv command).
  • Verify security groups: Make sure security groups allow CloudFront IP addresses on port 80/443 (depending on your setup).

Check CloudFront settings for coming_soon.html:

Is path correct? : Make sure it points to the exact location of the file on your server.

Is caching disabled? : Set "Cache Policy" to "Caching Disabled" to see the latest version.

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
0

Hello.

How about changing the path pattern as follows?
Try adding a "/" at the beginning.

/coming_soon.html
EXPERT
answered 2 years ago
0

@Riku_Kobayashi

Thank for your answer. It works if add "/" at the beginning.

Now, I want to no cache for this page, so i changed to the behaviour as the following (All TTL to be zero). But it doesn't work again (appear 504 again) Enter image description here

Any ideas?

Thanks

answered 2 years ago
0

Hi everyone,

Thanks for your guys helping first, and sorry for my poor english.

According to the suggestions, I created a new simple php page which just say halo and display current server time, like this: Enter image description here

Then I tested 3 cache behavior setting one by one:

Setting 1: Set Default TTL: 120 which makes the page cached 120 sec:

behavior-setting-01

Setting 1 result: It works, the page display in expected and the displayed time will be refreshed after reloading after 2 mins later

behavior-setting-01-result

Setting 2: Set Default TTL: 0:

behavior-setting-02

Setting 2 result: The result becomes very interesting: load normally in 1st time (x-cache: miss from cloudfront) show 504 error in 2nd time (x-cache: Error from cloudfront) load normally in 3rd time (x-cache: miss from cloudfront) show 504 error in 4th time (x-cache: Error from cloudfront) ...

behavior-setting-02-result

Setting 3: Changed all TTL to be zero

behavior-setting-03

Setting 3 result: The page shows 504 error every time

behavior-setting-03-result

After i checked the cloudfront logs & elb logs. I found there is error "OriginCommError" in cloudfront logs, but cannot find any "halo.php" request in elb logs.

It looks like the cloudfront drop the connection before ELB (cannot make a request to ELB) due to some "unknown reason".

Anyone can help? and give me a hits/guideline?

Sorry for my bad english again.

Thanks Wayne

answered 2 years 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.