server {
# ...
set $s3_server "s3.eu-central-1.amazonaws.com";
set $s3_bucket "wtf";
location / {
expires 30d;
proxy_set_header Host $s3_server;
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 $scheme;
proxy_pass $scheme://$s3_server/$s3_bucket/;
}
# ...
}
*) Bugfix: in the "proxy_pass", "fastcgi_pass", "scgi_pass", and
"uwsgi_pass" directives when using variables.