Nginx访问非常慢

由于域名绑定服务器IP,而服务器上部署了多个应用,想都通过域名访问,故弄了个Nginx转发。

加了Nginx以后,服务访问明显卡顿。

查看配置:

location / {
    proxy_pass http://localhost:8080/;
    rewrite ^/$    /index.do;
}

发现配置用的localhost。而hosts文件没有配置localhost指向127.0.0.1

localhost替换成127.0.0.1。如下: 

location / {
    proxy_pass http://127.0.0.1:8080/;
    rewrite ^/$    /index.do;
}
再访问服务卡顿现象没有了。

猜你喜欢

转载自www.cnblogs.com/sandyyeh/p/9198757.html
今日推荐