- Newest
- Most votes
- Most comments
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.
Hello.
How about changing the path pattern as follows?
Try adding a "/" at the beginning.
/coming_soon.html
@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)
Any ideas?
Thanks
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:
Then I tested 3 cache behavior setting one by one:
Setting 1: Set Default TTL: 120 which makes the page cached 120 sec:
Setting 1 result: It works, the page display in expected and the displayed time will be refreshed after reloading after 2 mins later
Setting 2: Set Default TTL: 0:
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) ...
Setting 3: Changed all TTL to be zero
Setting 3 result: The page shows 504 error every time
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
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked 3 years ago
- asked 3 years ago

There may also be a network issue, as described in the document below. For example, are you not allowing CloudFront's prefix list in your ALB security group, or are you unable to connect from CloudFront? https://repost.aws/knowledge-center/cloudfront-troubleshoot-504-errors Is it possible to access coming_soon.html without a path pattern?
After changing CloudFront settings, try clearing the cache. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html