Nginx 支持多种命令行参数,用于控制其行为。
nginx
nginx -t
nginx -s stop
nginx -s quit
nginx -s reopen
nginx -s reload
# 查看版本
nginx -v
# 查看版本和编译信息
nginx -V
# 指定配置文件
nginx -c /path/to/nginx.conf
# 指定前缀路径
nginx -p /path/to/prefix
# 设置全局指令
nginx -g "daemon off;"