[root@VM-0-7-centos sbin]# ./nginx -h
nginx version: nginx/1.22.0
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix]
[-e filename] [-c filename] [-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: /root/ng/artisan_ng/)
-e filename : set error log file (default: logs/error.log)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
[root@VM-0-7-centos sbin]# ./nginx -?
nginx version: nginx/1.22.0
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix]
[-e filename] [-c filename] [-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: /root/ng/artisan_ng/)
-e filename : set error log file (default: logs/error.log)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
[root@VM-0-7-centos sbin]#
使用指定的配置文件 -c
代码语言:javascript复制
[root@VM-0-7-centos ~]#
[root@VM-0-7-centos ~]# cd ng/artisan_ng/
[root@VM-0-7-centos artisan_ng]# ll
total 36 当前目录 /root/ng/artisan_ng
drwx------ 2 nobody root 4096 Oct 2 09:56 client_body_temp
drwxr-xr-x 2 root root 4096 Oct 2 09:55 conf
drwx------ 2 nobody root 4096 Oct 2 09:56 fastcgi_temp
drwxr-xr-x 2 root root 4096 Sep 26 00:14 html
drwxr-xr-x 2 root root 4096 Oct 2 09:56 logs
drwx------ 2 nobody root 4096 Oct 2 09:56 proxy_temp
drwxr-xr-x 2 root root 4096 Sep 26 00:14 sbin
drwx------ 2 nobody root 4096 Oct 2 09:56 scgi_temp
drwx------ 2 nobody root 4096 Oct 2 09:56 uwsgi_temp
[root@VM-0-7-centos artisan_ng]#
[root@VM-0-7-centos artisan_ng]# ./sbin/nginx -c ./conf/nginx.conf
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
^C (忽略这个错误,已经起来了ng)
[root@VM-0-7-centos artisan_ng]# cd sbin/
[root@VM-0-7-centos sbin]# ./nginx -c /root/ng/artisan_ng/conf/nginx.conf
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
^C (忽略这个错误,已经起来了ng)
[root@VM-0-7-centos sbin]#
指定配置指令 -g
代码语言:javascript复制
-g directives : set global directives out of configuration file