Nginx 命令
进入 Nginx 安装目录下的 sbin 目录
基础命令
# 启动命令, -c Nginx配置文件 ./nginx -c /usr/local/nginx/conf/nginx.conf # 重新加载配置文件 ./nginx -s reload # 快速停止 Nginx ./nginx -s stop # 完整有序的停止 ./nginx -s quit # 重启 ./nginx -s reopen
其他命令
# 测试 Nginx 配置文件是否正确两种方式 ./nginx -t -c /usr/local/nginx/conf/nginx.conf ./nginx -t # 查看版本 ./nginx -v
Nginx 所有命令
nginx version: nginx/1.15.8 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/local/nginx/) -c filename : set configuration file (default: conf/nginx.conf) -g directives : set global directives out of configuration file