Nginx的常用命令

1.nginx的常用命令

1.查看nginx的版本号

./nginx -v

[root@Nginx-node1 sbin]# ./nginx -v
nginx version: nginx/1.18.0
[root@Nginx-node1 sbin]# 

2.启动nginx

./nginx

[root@Nginx-node1 sbin]# ps -ef|grep nginx
root      3686     1  0 02:03 ?        00:00:00 nginx: master process ./nginx
nobody    3687  3686  0 02:03 ?        00:00:00 nginx: worker process
root     24830   970  0 02:24 pts/0    00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# ./nginx -s stop
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root     24834   970  0 02:25 pts/0    00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# 

3.关闭nginx

./nginx -s stop

[root@Nginx-node1 sbin]# ps -ef|grep nginx
root      3686     1  0 02:03 ?        00:00:00 nginx: master process ./nginx
nobody    3687  3686  0 02:03 ?        00:00:00 nginx: worker process
root     24830   970  0 02:24 pts/0    00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# ./nginx -s stop
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root     24834   970  0 02:25 pts/0    00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# 

4.重新加载nginx(在修改了nginx.conf配置文件后,不需要关闭nginx,直接重新加载配置文件就生效,比较有用)

./nginx -s reload

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。