2

I have a nginx server used as reverse proxy to various ec2 instances. Now I have a S3 bucket for static website hosting already set up for public read access and I want to put it behind nginx. The static website shows up just fine when typing the endpoint of my S3 bucket in a browser.

However, when trying to reach it from nginx, for some reason it simply redirects me to https://aws.amazon.com/s3/ instead of reaching the website hosted on my S3 bucket. I have tried many configs I found on the web to no avail.

Below is the current configuration of the server block:

 server{    
   listen 80;
   server_name _; 
   location /docs {
          resolver 8.8.8.8;
          proxy_set_header Host "mys3bucketname.s3-website.eu-central-1.amazonaws.com";
          proxy_pass http://mys3bucketname.s3-website.eu-central-1.amazonaws.com;
        }
}
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Jimmy
  • 21
  • 1
  • 2
  • This post seems to use a working model: https://stackoverflow.com/questions/44639182/nginx-proxy-amazon-s3-resources – Matt D Mar 13 '19 at 12:38

0 Answers0