Nginx自1.1.4以后内置支持Upstream Keepalive 配置。 upstream http_backend { server 127.0.0.1:8080; keepalive 16; } server { ... location /http/ { proxy_pass http://http_backend; proxy_http_version 1.1; proxy_set_header Connection ""; ... } }
更多细节可参考:
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream
http://blog.csdn.net/gzh0222/article/details/8523635
本文转自 古道卿 51CTO博客,原文链接:http://blog.51cto.com/gudaoqing/1543002