[root@web01 conf.d]# nginx -t
nginx: [emerg] invalid number of arguments in "root" directive in /etc/nginx/conf.d/text.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed
當用nginx -t 查看時報錯 以為是配置文件配置錯誤,檢查后配置沒有問題,想起來自己還創建了一個以.conf的文件,使用rm -f 刪除
[root@web01 conf.d]# rm -r text.conf
rm: remove regular file ‘text.conf’? yes
[root@web01 conf.d]# ll
total 4
-rw-r--r-- 1 root root 137 Jan 9 21:26 game.conf
[root@web01 conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful