nginx和tomcat在同一台服务器;
直接代理方式:
location = / {
#rewrite ^ http://$host/credit-website/ last;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 5m;
proxy_cache_valid any 2m;
proxy_pass http://127.0.0.1:8080/credit-website/;
access_log logs/1.log main;
}
upstream方式:
upstream website {
server 127.0.0.1:8080;
}
location = / {
#rewrite ^ http://$host/credit-website/ last;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 5m;
proxy_cache_valid any 2m;
proxy_pass http://website/credit-website/;
access_log logs/1.log main;
}
以上两种方式显示 nginx 响应时间$request_time 和 $upstream_response_time'都需要10s左右。
请问会有那些因素影响响应时间?