>  기사  >  백엔드 개발  >  nginx使用小结

nginx使用小结

WBOY
WBOY원래의
2016-07-28 08:27:481581검색

今天照着 http://cxshun.iteye.com/blog/1535188 这篇文章 做个一遍
出现了一些问题:

1 CreateDirectory() “D:\Program Files\nginx-1.11.2/temp/client_body_temp” failed (3: The system cannot find the path specified)
原因:好像是没有权限创建文件夹具体不祥(解决你帮它创建)
解决:在nginx.conf配置文件的http { }内,增加以下三行语句(要确定你的temp文件夹下有对应的文件夹)

<code> client_body_temp_path temp/client_body_temp;
    proxy_temp_path temp/proxy_temp;
    fastcgi_temp_path temp/fastcgi_temp;</code>

2 CreateFile() “D:\nginx-1.11.2/html/favicon.ico” failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: “GET /favicon.ico HTTP/1.1”, host: “localhost”, referrer: “http://localhost/”
原因:不祥
解决:关闭favicon.ico不存在时记录日志

<code>location = /favicon.ico {
log_not_found <span>off</span>;
access_log <span>off</span>;
}</code>

3 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, request: “GET /tomcat.css HTTP/1.1”, upstream: “http://[::1]:8080/tomcat.css“, host: “localhost”, referrer: “http://localhost/”
速度慢还出现以上错误
原因:不祥
解决:将localhost 改成 ip
或者在 hosts 文件 加上 127.0.0.1 localhost

同时设置一下在连接时间
proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间(代理连接超时)
proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时)
proxy_read_timeout 600; #连接成功后,后端服务器响应时间(代理接收超时)

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了 nginx使用小结,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.