From 46cbbc6d73db0dce957ea982f06e8b56558758fa Mon Sep 17 00:00:00 2001 From: Thomas Soubrier Date: Wed, 29 Mar 2023 17:52:31 +0900 Subject: [PATCH] Update object-storage-proxy.md (#1056) This documentation has I believe one very confusing point: It uses two times `YOUR_S3_HOSTNAME` in the nginx configuration example, however the second time it looks like you actually have to use `YOUR_BUCKET_NAME.YOUR_S3_HOSTNAME`. ## Explanation Mastodon is using path-style requests to S3 which looks like this: https://s3.region-code.amazonaws.com/bucket-name/key-name Once you enable the new virtual host nginx file using the current indications, the path-style request which goes to amazon looks like this: https://s3.region-code.amazonaws.com/key-name In other words, the bucket name is not being sent S3 and the images break. This is because the current instructions make it seem like the header Host name is not including the bucket `proxy_set_header Host YOUR_S3_HOSTNAME;` With the current path-style request integration, one must use the bucket name in the Host header for this to work, hence the proposed change to `proxy_set_header Host YOUR_BUCKET_NAME.YOUR_S3_HOSTNAME;` --- content/en/admin/optional/object-storage-proxy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/admin/optional/object-storage-proxy.md b/content/en/admin/optional/object-storage-proxy.md index b29842cc..2318a3e9 100644 --- a/content/en/admin/optional/object-storage-proxy.md +++ b/content/en/admin/optional/object-storage-proxy.md @@ -37,7 +37,7 @@ server { } resolver 8.8.8.8; - proxy_set_header Host YOUR_S3_HOSTNAME; + proxy_set_header Host YOUR_BUCKET_NAME.YOUR_S3_HOSTNAME; proxy_set_header Connection ''; proxy_set_header Authorization ''; proxy_hide_header Set-Cookie;