Created
June 27, 2019 01:45
-
-
Save Jamp/9da06cd95fcb529a4a7d8995b128c889 to your computer and use it in GitHub Desktop.
Serve all PDF Files on S3 with Nginx and Proxy Reverse(remember give public access on files en S3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.pdf { | |
try_files $uri $uri/ @aws; | |
} | |
location @aws { | |
proxy_pass https://<bucket_name>.s3.amazonaws.com; | |
proxy_set_header Host "<bucket_name>.s3.amazonaws.com"; | |
proxy_set_header Authorization ''; | |
proxy_hide_header x-amz-id-2; | |
proxy_hide_header x-amz-storage-class; | |
proxy_hide_header x-amz-request-id; | |
proxy_hide_header Set-Cookie; | |
proxy_ignore_headers "Set-Cookie"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment