Linux下几种重启Nginx的方式,找出nginx配置文件路径和测试配置文件是否正确
目录在/etc/ngnix/conf.d下
找出nginx配置文件路径和测试配置文件是否正确
# /usr/sbin/nginx -t
几种重启Nginx的方式:
service nginx restart
/etc/init.d/nginx restart
systemctl restart nginx
------------------------
[root@svr-005:~]$ /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@svr-005:~]$ service nginx restart
Stoping nginx... nginx is not running.
Starting nginx... /etc/init.d/nginx: line 38: /www/server/nginx/sbin/nginx: No such file or directory
failed