今天照着 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; #连接成功后,后端服务器响应时间(代理接收超时)
以上就介绍了 nginx使用小结,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。