webman用nginx做代理之后,在postman上响应需要十几秒,但在浏览器上响应却是毫秒级的?

test1688

问题描述

为什么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;
      }
  }
}
621 2 1
2个回答

TM

前几天看到作者回答过,浏览器请求后不会断开连接会保存的以便继续使用,APIpost和postman是请求一次建立一次连接的,并且好像这些测试工具还有点BUG。

  • 暂无评论
W

我猜:浏览器keepalive 10240;生效,而测试工具没有生效

  • 暂无评论
🔝