nginx.conf 文件配置负载均衡
在 server {
listen 80;
server_name localhost;
前面添加,下面代码
upstream minio-server {
server 192.168.129.51:9000 weight=25 max_fails=2 fail_timeout=30s;
server 192.168.129.52:9000 weight=25 max_fails=2 fail_timeout=30s;
server 192.168.129.53:9000 weight=25 max_fails=2 fail_timeout=30s;
server 192.168.129.54:9000 weight=25 max_fails=2 fail_timeout=30s;
}
在 server 里面中
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
# root html;
# index index.html index.html;
#添加的
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
client_body_buffer_size 10M;
client_max_body_size 10G;
proxy_buffers 1024 4k;
proxy_read_timeout 300;
proxy_next_upstream error timeout http_404;
proxy_pass http://minio-server;
#添加的
}