http {
access_log on;
default_type application/octet-stream;
include mime.types;
sendfile on;
keepalive_timeout 0;
client_header_timeout 60;
client_body_timeout 60;
reset_timeout_connection on;
send_timeout 60;
gzip on;
tcp_nopush on;
port_in_redirect off;
sercer_tokens off;
server {
...
location /api{
proxy_pass ...;
proxy_http_version 1.1;
proxy_set_header Connection close;
}
}
}
Http1.1 Keep-Alive默认支持并开启,你发的 Header 是浏览器默认发出的,得看服务端 response header 中响应什么