I have a weird situation where every second request fails with 504, and every other request succeeds (the expected response for https://www.voxviva.app/ is to get a 307 that points to https://www.voxviva.app/en )
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 307
content-type: text/html
date: Thu, 14 Sep 2023 10:46:49 GMT
location: /en
strict-transport-security: max-age=15724800; includeSubDomains
x-cache: Miss from cloudfront
via: 1.1 f6d693d2da795055838b1c110137b89c.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: HibGevOKUNtICW0AlFTX_ypxUm-_t-gfUJQ0cPbVqws_50Ux9-hnkA==
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 504
content-type: text/html
content-length: 1033
server: CloudFront
date: Thu, 14 Sep 2023 10:47:24 GMT
x-cache: Error from cloudfront
via: 1.1 f0f40cec74c0c7e87f64d4eee853867a.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: DyhaxIAhEwepIWRNMpkwxuyD60BrqwW3lLBYspaCQCIT25884sTnFg==
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 307
content-type: text/html
date: Thu, 14 Sep 2023 10:49:17 GMT
location: /en
strict-transport-security: max-age=15724800; includeSubDomains
x-cache: Miss from cloudfront
via: 1.1 457123b46297b2878de5b87c0fb16090.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: lVrIvOoyggScR20IvL8oL5jK5DBLFsiZ__HcDejeDurM_Mgfm4y8bg==
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 504
content-type: text/html
content-length: 1033
server: CloudFront
date: Thu, 14 Sep 2023 10:49:52 GMT
x-cache: Error from cloudfront
via: 1.1 87edbe6dffa6ef8010cc5cc902bcafa0.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: iiLiUBbo1sUfsXJg6NMPCMjeCcnhXpBsBa_wAW25I_OeveVi4BkV9g==
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 307
content-type: text/html
date: Thu, 14 Sep 2023 10:50:18 GMT
location: /en
strict-transport-security: max-age=15724800; includeSubDomains
x-cache: Miss from cloudfront
via: 1.1 136fd1617e777ad27200226c42b35398.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: Q3wcsmS61YliZP5lvexVa44FfzTa62ThG6Anzsb6uXa1-RV-xsUe4g==
dolf@astro:~$ curl -I https://www.voxviva.app/
HTTP/2 504
content-type: text/html
content-length: 1033
server: CloudFront
date: Thu, 14 Sep 2023 10:50:51 GMT
x-cache: Error from cloudfront
via: 1.1 f0f40cec74c0c7e87f64d4eee853867a.cloudfront.net (CloudFront)
x-amz-cf-pop: JNB50-C1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: PN08JbiWNnC2dcUZzA197oN09MxHbe639Pp-_tuaLWHtq5ah2x6IDg==
I have fiddled with settings and read documentation, and could find nothing that fixes this.
I have also tried the advice at https://repost.aws/knowledge-center/cloudfront-troubleshoot-504-errors to test the speed of my origin (which is public.voxviva.app ), and the "Total time" printed is always under 1 second:
curl -w "DNS Lookup Time: %{time_namelookup} \nConnect time: %{time_connect} \nTLS Setup: %{time_appconnect} \nRedirect Time: %{time_redirect} \nTime to first byte: %{time_starttransfer} \nTotal time: %{time_total} \n" -o /dev/null https://public.voxviva.app
Any advice would be greatly appreciated.
I can't reproduce the problem. Tried over 20 times and each time I got 307 code. I see that there is only one IP address returned, so it's not a case.
I ran
curl -I https://www.voxviva.app/
from a few more places:I asked a few other people in South Africa to test using the following script:
This was run on several different ISPs, operating systems, hardware, etc. Only one person got consistent 307s. The rest all either see the responses toggle between 504 and 307 like I do, or they see multiple 504s followed by multiple 307s, repeatedly.
The 504 problem seems to have disappeared. I asked everyone who tested previously to test again, and everyone gets consistent 307s now. We did not change anything in our own infrastructure or in our AWS configuration. So maybe this was just a temporary glitch at one of the edge locations in South Africa.