Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.5 kB
1
Indexable
Never
server {
        listen       80;
        server_name  foo.bar;
        root         /usr/share/nginx/html;
        set $bucket "mybucket_name.s3-my-region.amazonaws.com";
        location / {
                resolver 10.x.x.2; #aws vpc
                proxy_http_version     1.1;
                proxy_redirect off;
                proxy_set_header       Connection "";
                proxy_set_header       Authorization '';
                proxy_set_header       Host $bucket;
                proxy_set_header       X-Real-IP $remote_addr;
                proxy_set_header       X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_hide_header      x-amz-id-2;
                proxy_hide_header      x-amz-request-id;
                proxy_hide_header      x-amz-meta-server-side-encryption;
                proxy_hide_header      x-amz-server-side-encryption;
                proxy_hide_header      Set-Cookie;
                proxy_ignore_headers   Set-Cookie;
                proxy_intercept_errors on;
                add_header             Cache-Control max-age=31536000;
                proxy_pass             http://$bucket;
        }

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        error_page 404 /404.html;
        location = /404.html {
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        }
    }