【nginx】常用命令 启动|停止|重启|重新读取配置-centOS7


 查看服务的当前状态

(flaskApi) [root@67 goTest]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: active (running) since 一 2019-10-21 13:52:34 CST; 3min 56s ago Main PID: 25799 (nginx) CGroup: /system.slice/nginx.service ├─25799 nginx: master process /usr/sbin/nginx ├─25800 nginx: worker process ├─25801 nginx: worker process ├─25802 nginx: worker process └─25803 nginx: worker process 10月 21 13:52:34 67.59.247.60.static.bjtelecom.net systemd[1]: Starting The nginx HTTP and r.... 10月 21 13:52:34 67.59.247.60.static.bjtelecom.net nginx[25793]: nginx: the configuration fi...k 10月 21 13:52:34 67.59.247.60.static.bjtelecom.net nginx[25793]: nginx: configuration file /...l 10月 21 13:52:34 67.59.247.60.static.bjtelecom.net systemd[1]: Started The nginx HTTP and re.... Hint: Some lines were ellipsized, use -l to show in full.

启动nginx服务

systemctl start nginx.service

停止nginx服务

systemctl stop nginx.service 

 重新启动服务

systemctl restart nginx.service

重新读取nginx配置(这个最常用, 不用停止nginx服务就能使修改的配置生效)

systemctl reload nginx.service

 

参考文档:写的超全,又清楚又详细!

centos7安装Nginx配置自启动命令

 

另:最新版本的nginx启动后,通过浏览器访问,不再是熟悉的welcome to nginx页面,而是下面这样子了

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM