命令行参数

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;"