反向代理的配置如下:
upstream my_upstream {
server 47.243.56.222:80;
keepalive 2048;
}
server {
listen 127.0.0.1:80 backlog=10240;
location /{
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_pass http://my_upstream;
}
upstream服务配置如下:
http {
keepalive_timeout 300s;
keepalive_requests 1000;
default_type text/plain;
server {
listen 80 backlog=102400;
server_name localhost;
location / {
root "/usr/local/openresty/nginx/data";
}
}
按照配置通过反向代理请求upstream服务时,反向代理的nginx和upstream之间的一个长连接应该处理1000个HTTP请求才会断开。但是现在测试发现每个长连接仅仅处理100(默认值)个HTTP请求后,反向代理的nginx就主动断开了连接,谁知道问题的原因呢?请大家多多指教