在nginx反向代理的配置文件中设置proxy_buffering为off,关闭响应缓存
location / {
proxy_pass http://your_upstream_server;
proxy_buffering off; # 关闭响应缓存
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
注:会影响响应延迟时间