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 —指定配置文件,不使用默认文件
-
-e file — use an alternative
error log file to store the log
instead of a default file (1.19.5).
The special value stderr selects the standard error file.
-e file —使用其他错误日志文件存储日志,而不是默认文件(nginx版本1.19.5)。stderr会选择标准错误文件。
-
-g directives — set
global configuration directives,
for example,
-g directives —设置全局配置指令,如
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 signal — 向主进程发送信号。可被接受的信号参是
-
-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相同,但会将配置文件转储到标准输出(从nginx版本:1.9.2开始支持)。
-
-v — print nginx version.
-v — 打印nginx版本
-
-V — print nginx version, compiler version,
and configure parameters.
-V — 打印nginx版本、编译器版本和配置参数。