今天照著 http://cxshun.iteye.com/blog/1535188 這篇文章 做個一次
出現了一些問題:
1 CreateDirectory() “D:Program Filesnginx-1.11.2/temp/client_body_temp” failed (3: The system cannot find the path specified)
ified
原因:好像是沒有權限創建資料夾具體不祥(解決你幫它創建)
解決:在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, connection, failed. 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教學有興趣的朋友有幫助。