负载均衡
upstream dwservers {
server 192.168.0.70:51121 weight=1;
server 192.168.0.70:51122 weight=2;
keepalive 1000; #根据qps来调整
}
server {
listen 51120;
server_name localhost;
#charset koi8-r;
access_log logs/51120.access.log ;
proxy_connect_timeout 1200; #加大120
proxy_send_timeout 1200; #加大120
proxy_read_timeout 1200; #加大120
proxy_http_version 1.1; #开启后端,长连接
proxy_set_header Connection ""; #开启后端,长连接
location /dwLibraryFile/ {
rewrite ^/dwLibraryFile/(.*) /$1 break;
proxy_pass http://dwservers;
}
}