1.nginx 发送信号nginx
#发送reload信号 从新加载配置文件(同kill -9) [root@i-vvwtw5ne sbin]# ./nginx -s reload #发送stop信号 马上中止服务 [root@i-vvwtw5ne sbin]# ./nginx -s stop #发送quit信号 优雅的中止服务 [root@i-vvwtw5ne sbin]# ./nginx -s quit #发送reopen信号 从新开始记录日志文件 [root@i-vvwtw5ne sbin]# ./nginx -s reopen
2. 获取nginx的帮助测试
[root@i-vvwtw5ne sbin]# ./nginx -h nginx version: nginx/1.16.1 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: /opt/nginx/) -c filename : set configuration file (default: conf/nginx.conf) -g directives : set global directives out of configuration file
3. nginx默认用$installPath/conf/nginx.conf的配置文件,也能够使用指定的配置文件,以下ui
[root@i-vvwtw5ne sbin]# ./nginx -c /opt/nginx/conf/mynginx.conf
4. 测试配置文件是否有语法错误this
[root@i-vvwtw5ne sbin]# ./nginx -t
5. 打印nignx的版本信息命令行
[root@i-vvwtw5ne sbin]# ./nginx -v