nginx 支持的命令行参数
Command-line parameters
命令行参数
nginx supports the following command-line parameters:
nginx支持以下命令行参数
-? | -h — print help for command-line parameters.
-? | -h —打印命令行参数的帮助
-c file — use an alternative configuration file instead of a default file.
-c file —使用可选的配置文件替代默认的配置文件
-g directives — set global configuration directives, for example,
-g 指令 —设置全局配置指令,例如
nginx -g "pid /var/run/nginx.pid; worker_processes sysctl -n hw.ncpu
;"
-p prefix — set nginx path prefix, i.e. a directory that will keep server files (default value is /usr/local/nginx).
-p prefix —设置nginx的预设路径。例如:一个将要保存服务器文件的目录(默认值是/usr/local/nginx)
-q — suppress non-error messages during configuration testing.
-q —在配置文件测试期间抑制非错误消息
-s signal — send a signal to the master process. The argument signal can be one of:
-s 信号 — 发送一个信号给主进程。参数信号可以是下列之一:
stop — shut down quickly
stop — 迅速关闭
quit — shut down gracefully
quit — 优雅的关闭
reload — reload configuration, start the new worker process with a new configuration, gracefully shut down old worker processes.
reload — 重载配置文件,用新的配置文件开启新的工作进程。优雅的关闭旧的进程。(也就是等旧的进程完成工作以后再结束它,不接受新的工作。)
reopen — reopen log files
reopen — 重新打开日志文件
-t — test the configuration file: nginx checks the configuration for correct syntax, and then tries to open files referred in the configuration.
-t —测试配置文件:nginx检查配置文件的语法,然后尝试打开配置文件中涉及的文件。
-T — same as -t, but additionally dump configuration files to standard output (1.9.2).
-T — 与-t参数一样,但另外还要将配置文件转储到标准输出。
-V — print nginx version, compiler version, and configure parameters.
-V — 打印nginx的版本,编译版本和配置参数