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;
}
再访问服务卡顿现象没有了。
posted @ 2018-06-19 15:24  江南叶少  阅读(16719)  评论(0编辑  收藏  举报