后端要求前端使用HTTP1.1版本,并且请求头Connection为close,nginx配置里设置好后不生效
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;
}
}
}