tft每日頭條

 > 科技

 > nginx配置文件解析

nginx配置文件解析

科技 更新时间:2025-03-13 00:22:22
nginx: [emerg] invalid number of arguments in "root" directive in /usr/local/nginx/conf/nginx.conf:20

nginx配置文件解析(nginx配置文件報錯nginx:)1

錯誤原因:配置文件第20行報錯

輸入命令再次檢查:配置文件信息:

在sbin目錄下

輸入nginx -t

nginx: [emerg] invalid number of arguments in "root" directive in /usr/local/nginx/conf/nginx.conf:20

nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

nginx配置文件解析(nginx配置文件報錯nginx:)2

确定了配置文件有問題

找到配置文件

nginx配置文件解析(nginx配置文件報錯nginx:)3

發現20行上面19行 少一個分号;

問題找到,添加分号後,保存成功.再檢查配置文件nginx -t

nginx配置文件解析(nginx配置文件報錯nginx:)4

重啟nginx

重啟命令./nginx 或者重新加載啟動

...nginx/sbin/nginx -c .../nginx/sbin/conf/nginx.conf

目錄下的以及子目錄下的所有執行權限可讀可寫可操作權限chmod 777 -R ./html或者 chmod -R u x ./html

nginx配置文件解析(nginx配置文件報錯nginx:)5

nginx配置文件解析(nginx配置文件報錯nginx:)6

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关科技资讯推荐

热门科技资讯推荐

网友关注

Copyright 2023-2025 - www.tftnews.com All Rights Reserved