1

Having kubernetes cluster with nginx ingress, pointed to AWS ELB load balancer and Route 53 domain pointed to this ELB is working just fine. Now I am trying to add cloudfront, it's pointing to load balancer, but it shows 404 Default backend all the time. It seems cloudfront is not passing domain correctly, or am I missing something else?

Tom
  • 113
  • 1
  • 6

1 Answers1

2

A quick search surfaced an Amazon support article that claims you must whitelist headers in order for CloudFront to pass them along, and apparently host: is not one that is in the default whitelist

There's a similar question which discusses some more scenarios

mdaniel
  • 2,338
  • 1
  • 8
  • 13
  • Hello, thanks for the reply. I've tried this and it's directing traffic to my service, but it keeps redirecting 308. This is the log 172.20.37.10 - [172.20.37.10] - - [22/Mar/2020:07:16:11 +0000] "GET /graphql HTTP/1.1" 308 177 "-" "Amazon CloudFront" 460 0.000 [default-graphql-gateway-5900] [] - - - - On the other hand if I try normal request (not via CF) logs look like this - - [22/Mar/2020:07:16:47 +0000] "POST / HTTP/2.0" 200 4504 "https://api-gw.xxx.com/" " /537.36 (KHTML, like Gecko) Safari/537.36" 1487 0.096 [default-graphql-gateway-5900] [] 100.96.3.243:5900 41421 0.092 200 – Tom Mar 22 '20 at 07:18
  • It's ok now, I had to setup ingress without TLS as CF is directing traffic over HTTP. Thanks. – Tom Mar 22 '20 at 08:08