【发布时间】:2021-11-08 22:57:07
【问题描述】:
在 Ubuntu 20.04 中:
我安装了 openresty 并且运行良好。
它使用默认的/usr/local/openresty/nginx/conf/nginx.conf。
我想在~/conf/nginx.conf 中使用新的自定义nginx.conf 文件。
如何让 openresty 在这个新的 conf 文件上运行?
【问题讨论】:
在 Ubuntu 20.04 中:
我安装了 openresty 并且运行良好。
它使用默认的/usr/local/openresty/nginx/conf/nginx.conf。
我想在~/conf/nginx.conf 中使用新的自定义nginx.conf 文件。
如何让 openresty 在这个新的 conf 文件上运行?
【问题讨论】:
刚刚找到答案:
ubuntu@john:~$ openresty -help
nginx version: openresty/1.19.9.1
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix]
[-e filename] [-c filename] [-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/openresty/nginx/)
-e filename : set error log file (default: logs/error.log)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
使用
openresty -c filename
【讨论】: