nginx代理 minio
warning:
这篇文章距离上次修改已过188天,其中的内容可能已经有所变动。
## 客户端
upstream minio {
##minio服务器1,权重越高被分配到的几率越大
server 192.168.0.37:9001 weight=1;
##minio服务器2
server 192.168.0.38:9001 weight=1;
##minio服务器3
server 192.168.0.39:9001 weight=1;
}
server{
listen 9001;
server_name localhost;
location / {
proxy_pass http://minio;
# 添加websocket支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# 客户端请求服务器最大允许大小-不限(文件大小)
client_max_body_size 0;
## 服务端
upstream minioServer {
##minio服务器1,权重越高被分配到的几率越大
server 192.168.0.37:9000 weight=1;
##minio服务器2
server 192.168.0.38:9000 weight=1;
##minio服务器3
server 192.168.0.39:9000 weight=1;
}
server{
listen 9000;
server_name localhost;
location / {
proxy_pass http://minioServer;
# 添加websocket支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
好东西,学习学习。
这篇文章写得深入浅出,让我这个小白也看懂了!