【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

猜你喜欢

转载自blog.csdn.net/daohangtaiqian/article/details/129119326