nginx 原生命令
2017-12-25 本文已影响9人
jiaxiaolei
nginx 原生命令:
在docker container 中执行 nginx , 发现之前在宿主机上用的很好的 service没有, systemctl 也不好用。
只能用最基本的nginx 命令了。这里简单记录一下,备忘。
$ nginx -h
nginx version: nginx/1.12.2
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/share/nginx/)
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
-g directives : set global directives out of configuration file
启动nginx
$ nginx
$ ps aux|grep nginx
root 142 0.0 0.0 122920 2272 ? Ss 08:57 0:00 nginx: master process nginx
nginx 143 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 144 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 145 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 146 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 147 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 148 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 149 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
nginx 150 0.0 0.0 123316 3156 ? S 08:57 0:00 nginx: worker process
root 152 0.0 0.0 9048 664 ? S+ 08:57 0:00 grep --color=auto nginx
重启nginx
$ nginx -s reload