在使用Nginx做HTTP反向代理的时候,如果出现大量的TIME_WAIT,把Nginx和后端服务器的连接方式改为http1.1即可。
配置如下
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
记得要把Connection抹掉,不然http还是会不断第重连