Serving a S3 Bucket with Kubernetes and Ingress-Nginx

The traditional, production-ready way to serve a S3 bucket in production is usually to create a CloudFront distribution, add a S3 origin and configure the desired behaviour. However, this comes with a small caveat: while you can specify an origin path, this will make CloudFront request the bucket from the path directory, then appending the requested URL. For example, given the test origin path, example.com/index.html will retrieve s3://bucket-name/test/index.html; example.com/folder/index.html will retrieve s3://bucket-name/test/folder/index....

March 3, 2024 · 2 min · Adrien Poupa