為什么webman用nginx做代理之后,在apipost和postman上響應需要十幾秒,但在瀏覽器上響應確是毫秒級的?
反向代理配置如下:
upstream webman {
server 127.0.0.1:8787;
keepalive 10240;
}
server {
server_name xxx;
listen 80;
access_log off;
root xxx;
location ^~ / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
if (!-f $request_filename){
proxy_pass http://webman;
}
}
}
前幾天看到作者回答過,瀏覽器請求后不會斷開連接會保存的以便繼續(xù)使用,APIpost和postman是請求一次建立一次連接的,并且好像這些測試工具還有點BUG。