You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.8 KiB
38 lines
1.8 KiB
# HTTP 1.1 support
|
|
proxy_http_version 1.1;
|
|
|
|
# IMPORTANT: For S3 API with AWS Signature V4 authentication, you MUST:
|
|
# 1. Use $http_host (not $host) to preserve port numbers
|
|
# 2. Keep proxy_pass_request_headers on (default) to pass all headers unchanged
|
|
# 3. Set proxy_request_buffering off for chunked uploads
|
|
# 4. NOT explicitly set Authorization or X-Amz-* headers
|
|
# See docker/nginx/README.md for detailed S3 reverse proxy configuration
|
|
|
|
#proxy_buffering off;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $proxy_connection;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
|
|
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
|
|
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
|
|
|
|
# Mitigate httpoxy attack (see README for details)
|
|
proxy_set_header Proxy "";
|
|
|
|
# aws default max_concurrent_requests 10
|
|
# aws default multipart_threshold 8MB
|
|
proxy_buffering on; # GET buffering or “X-Accel-Buffering” enables or disables buffering of a response;
|
|
proxy_buffers 64 1m; # buffers used for reading a response from the proxied server, for a single connection
|
|
proxy_buffer_size 8k; # maximum size of the data that nginx can receive from the server at a time is set
|
|
proxy_busy_buffers_size 2m;
|
|
|
|
proxy_request_buffering on; # PUT buffering (set to 'off' for S3 chunked uploads)
|
|
client_body_buffer_size 64m; # buffer size for reading client request body
|
|
client_max_body_size 64m;
|
|
|
|
proxy_next_upstream error timeout non_idempotent http_500; # PUT request should be passed to the next server:
|
|
proxy_connect_timeout 200ms;
|
|
proxy_read_timeout 3s; #timeout is set only between two successive read operations
|
|
proxy_send_timeout 3s; #timeout is set only between two successive write operations
|