🐛 Strip Authorization header when proxying asset redirects to S3 (#10777)

When nginx follows a backend 307 redirect to a presigned S3 URL, it was
forwarding the client's Authorization header to S3. Production S3 rejects
this because it sees two auth mechanisms (presigned URL signature +
Authorization header). MinIO in devenv is more lenient and ignores the
extra header.

Fix: add proxy_set_header Authorization "" in the @handle_redirect block.

Fixes #10776

AI-assisted-by: mimo-v2.5-pro
This commit is contained in:
Andrey Antukh 2026-07-22 14:00:35 +02:00 committed by GitHub
parent bdce5817ea
commit 80c84a3331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,7 @@ http {
set $real_mtype "$upstream_http_x_mtype";
proxy_set_header Host "$redirect_host";
proxy_set_header Authorization "";
proxy_hide_header etag;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;

View File

@ -94,6 +94,7 @@ http {
proxy_buffering off;
proxy_set_header Host "$redirect_host";
proxy_set_header Authorization "";
proxy_hide_header etag;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;