Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/installation/docker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ server {

# 反向代理 RustFS S3 API
location / {
proxy_set_header Host $host;
proxy_set_header Host $http_host;
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;
Expand Down Expand Up @@ -386,7 +386,7 @@ server {

# 反向代理 RustFS 控制台
location / {
proxy_set_header Host $host;
proxy_set_header Host $http_host;
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;
Expand Down
18 changes: 15 additions & 3 deletions docs/integration/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;

# Disable Nginx from converting HEAD to GET
# proxy_cache_convert_head off;
proxy_cache_convert_head off;

proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
Expand Down Expand Up @@ -101,7 +101,7 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;

# Disable Nginx from converting HEAD to GET
# proxy_cache_convert_head off;
proxy_cache_convert_head off;

proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
Expand All @@ -122,6 +122,18 @@ server {

~~~

#### 重要说明

> [!WARNING]
> **关键配置项**
>
> 在 Nginx 配置中**必须添加** `proxy_cache_convert_head off` 指令,原因如下:
>
> - Nginx 默认会将 HEAD 请求转换为 GET 请求以便缓存
> - 这种转换会导致 S3 V4 签名验证失败
> - 症状表现为访问存储桶时报错 `Bucket not found` 或 `403 AccessDenied`
>
> 参考 [Nginx 官方文档](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_convert_head)。

## 三、多机负载均衡

Expand Down Expand Up @@ -215,4 +227,4 @@ server {
proxy_pass http://127.0.0.1:9001;
}
}
~~~
~~~