用命令检查nginx配置文件语法是否正确

nginx -tc 你要检测的配置文件的路径

D:\software\nginx\nginx-1.20.1>nginx -tc ./conf/nginx.conf
nginx: the configuration file ./conf/nginx.conf syntax is ok
nginx: configuration file ./conf/nginx.conf test is successful

正确的情况:

有误的情况有:

 

 

你可能感兴趣的:(nginx,服务器)