4

I want to open files from S3 served by Nginx in a browser. Was unable to get it working with following config

Files in S3 buckets are text files with extension .manefiest

location /manefiest/ {
    proxy_pass http://my-bucket.s3-website-us-west-2.amazonaws.com/;
    types {
        text/html manefiest;
        text/plain manefiest;
    }
}

I want browser to show the contents of the file. But with above config it was downloading the file.

Whats wrong here ?

roy
  • 6,344
  • 24
  • 92
  • 174
  • 1
    This might help: https://stackoverflow.com/questions/14150854/aws-s3-display-file-inline-instead-of-force-download – ofirule Nov 05 '20 at 23:14

1 Answers1

3

Setting contentType:"text/plain" for uploaded file solved the problem.

Thanks @ofirule

roy
  • 6,344
  • 24
  • 92
  • 174