1. 程式人生 > 實用技巧 >nginx: [emerg] CreateDirectory() "D:\tools\nginx-1.14.0/temp/client_body_temp" failed (3: The system cannot find the path specified)

nginx: [emerg] CreateDirectory() "D:\tools\nginx-1.14.0/temp/client_body_temp" failed (3: The system cannot find the path specified)

在Windows中啟動nginx提示如下資訊

nginx: [emerg] CreateDirectory() "D:\tools\nginx-1.14.0/temp/client_body_temp" failed (3: The system cannot find the path specified)

找不到指定路徑(可能是以前改配置改的,記不清了),只能重新解壓一次了。

啟動和停止都需要使用命令,不然不會停止

Nginx運用場景如下:

1、http伺服器。Nginx是一個http服務可以獨立提供http服務。可以做網頁靜態伺服器。
2、虛擬主機。可以實現在一臺伺服器虛擬出多個網站。例如個人網站使用的虛擬主機。

3、反向代理,負載均衡。當網站的訪問量達到一定程度後,單臺伺服器不能滿足使用者的請求時,需要用多臺伺服器叢集可以使用nginx做反向代理。並且多臺伺服器可以平均分擔負載,不會因為某臺伺服器負載高宕機而某臺伺服器閒置的情況。

Nginx下載:http://nginx.org/en/download.html

常用命令

nginx -t   驗證(nginx.conf)配置檔案是否有語法錯誤
nginx -V   檢視Nginx的版本號
start nginx   啟動Nginx (windows下start nginx)

nginx.exe  啟動Nginx
nginx -c /usr/local/nginx/conf/nginx.conf   啟動nginx

nginx -s stop   快速停止或關閉Nginx
nginx -s quit   正常停止或關閉Nginx
nginx -s reload   配置檔案修改重灌載命令
nginx -h   檢視幫助資訊
nginx -s reopen   開啟日誌檔案