nginx反向代理访问速度慢

枫桥 2016-02-20 01:47:19
nginx反向代理访问速度慢, 配置如下
server {
listen 80;
server_name localhost:8080;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
proxy_pass http://localhost:8080;
}
日志:
2016/02/20 13:21:53 [error] 12244#11736: CreateFile() "C:\Users\Administrator\Desktop\nginx-1.9.11\nginx-1.9.11/logs/nginx.pid" failed (2: The system cannot find the file specified)
2016/02/20 13:23:14 [error] 6752#2756: *64 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost:8080, request: "GET /tomcat.png HTTP/1.1", upstream: "http://[::1]:8080/tomcat.png", host: "localhost", referrer: "http://localhost/"
2016/02/20 13:33:28 [error] 6752#2756: *78 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost:8080, request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", host: "localhost"
目测是不能创建nginx.pid这个文件
将localhost改为127.0.0.1后速度正常,可以正常创建nginx.pid这个文件,但是为什么localhost不可以呢?原因有谁知道吗
...全文
3159 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
铁铲 2016-07-06
  • 打赏
  • 举报
回复
你在 hosts 文件加上 127.0.0.1 localhost 就可以用 localhost 了

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧