nginx -t -c nginx.conf
結(jié)果提示錯(cuò)誤:
?nginx: the configuration file 'D:\nginx-1.15.3\conf/nginx.conf syntax is ok
nginx: [emerg] CreateDirectory() "'D:\nginx-1.15.3\conf/temp/client_body_temp" failed (3: The system cannot find the path specified)
nginx: configuration file 'D:\nginx-1.15.3\conf/nginx.conf test failed
并且運(yùn)行如下命令:
nginx -t
也是出現(xiàn)錯(cuò)誤提示:
nginx: [emerg] CreateFile() "'D:\nginx-1.15.3\conf/conf/nginx.conf" failed (3: The system cannot find the path specified)
nginx: configuration file 'D:\nginx-1.15.3\conf/conf/nginx.conf test failed
百思不得其解,后來在命令行上退出 conf 目錄,回到根目錄 'D:\nginx-1.15.3' ,如下運(yùn)行命令:
D:\nginx-1.15.3> nginx -t -c conf\nginx.conf
則顯示配置文件正確:
nginx: the configuration file D:\nginx-1.15.3/conf\nginx.conf syntax is ok
nginx: configuration file D:\nginx-1.15.3/conf\nginx.conf test is successful
并且,運(yùn)行命令:
D:\nginx-1.15.3> nginx -t
顯示nginx安裝正常
nginx: the configuration file D:\nginx-1.15.3/conf/nginx.conf syntax is ok
nginx: configuration file D:\nginx-1.15.3/conf/nginx.conf test is successful
附 nginx 常用命令:
驗(yàn)證配置是否正確: nginx -t
查看Nginx的版本號:nginx -V
啟動Nginx:start nginx
快速停止或關(guān)閉Nginx:nginx -s stop
正常停止或關(guān)閉Nginx:nginx -s quit
配置文件修改重裝載命令:nginx -s reload
該文章在 2025/9/1 10:36:43 編輯過