【Nginx】检查配置文件是否正确

1.进入配置nginx路径

/usr/local/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf

2.返回这个就是正确

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

3.可以重启

systemctl restart nginx

其他两种启动方式:

service nginx restart

/usr/sbin/nginx -s reload

你可能感兴趣的:(#,Nginx,nginx,运维,linux)