Nginx 配置如下:
upstream nacos-server { server 172.31.1.186:8848 weight=1 max_fails=2 fail_timeout=30s; server 172.31.1.186:8850 weight=1 max_fails=2 fail_timeout=30s; server 172.31.1.186:8852 weight=1 max_fails=2 fail_timeout=30s; }
server { listen 8000; server_name localhost; charset utf-8; default_type text/html;
location ~ /nacos/* {
proxy_pass http://nacos-server;
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_set_header X-Real-IP $remote_addr;
proxy_set_header Cookie $http_cookie;
proxy_pass_header User-Agent;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}