compiler-explorer / infra

Infrastructure to set up the public Compiler Explorer instances and compilers
https://godbolt.org
BSD 2-Clause "Simplified" License
351 stars 306 forks source link

5xx errors when hitting weird sub-sub-domains #170

Open mattgodbolt opened 5 years ago

mattgodbolt commented 5 years ago

Hitting https://sx-baidu.cn.godbolt.org/robots.txt (and ignoring the security errors about the cert being invalid) :


The request could not be satisfied.
CloudFront wasn't able to connect to the origin. 
If you received this error while trying to use an app or access a website, please contact the provider or website owner for assistance. 
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by following steps in the CloudFront documentation (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-502-bad-gateway.html). 
Generated by cloudfront (CloudFront)
Request ID: MhicKumuYWTtnlclqom4565kF2jWfWo_2fk3Wg16RJ-MFqpnP2OVBg==```

A spam of these just caused a "5xx error rate" SMS alert.
mattgodbolt commented 5 years ago

Quick investigation:

ubuntu@ip-172-30-2-129:~$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /robots.txt HTTP/1.1
Host: foo.bar.baz.godbolt.org

HTTP/1.1 200 OK
Server: nginx/1.15.9
Date: Sun, 10 Mar 2019 03:58:32 GMT
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: Express
Cache-Control: public, max-age=30, must-revalidate

40
User-agent: *
Sitemap: https://godbolt.org/sitemap.xml
Disallow:
0

looks like from the nodes themselves, getting these requests are OK. I wonder whether it's an authentication thing https cloudfront <-> ALB (which has the same issues the browser has with browser<->cloudfront.