关于nginx对于rustfs的反向代理配置
·
1、假设目标机器的IP是IP1,即 rustfs的地址
2、nginx反向代理配置部分
location /partfile/ {
proxy_buffering off;
proxy_request_buffering off;
# 关键:强制告诉 RustFS,请求来自它自己
# 把 $host 改成 RustFS 实际监听的地址
proxy_set_header Host $proxy_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;
# 末尾必须加 /
proxy_pass http://IP1:9000/;
# 解决 CORS 和 OPTIONS 预检
proxy_set_header Access-Control-Allow-Origin *;
proxy_set_header Access-Control-Allow-Methods GET,PUT,POST,DELETE,OPTIONS;
proxy_set_header Access-Control-Allow-Headers *;
}
更多推荐

所有评论(0)