gpt4 book ai didi

nginx - 运行 service start/stop/restart nginx 命令时调用 openresty 的 nginx.conf 文件

转载 作者:行者123 更新时间:2023-12-05 05:27:17 25 4
gpt4 key购买 nike

我正在使用 nginx 作为我的 Django 项目的 Web 服务器。
我正在使用命令

sudo service nginx start/stop/restart 
管理 nginx 服务器。现在我正在使用 Openresty 框架将 Lua 代码实现到 nginx 服务器中以处理缓存系统。
Openrestry 提供了它自己的 nginx.conf 文件。要求:现在我想要然后当我运行
sudo service nginx start/stop/restart 
系统应该调用 Openresty 文件夹中的 nginx.conf 文件( /usr/local/openresty/nginx/conf/nginx.conf 代替 /etc/nginx/nginx.confM文件。
我怎样才能做到这一点???

最佳答案

你应该去

cd /etc/init.d 
vim nginx.conf
#Edit PATH , DAEMON variablePATH=/usr/local/openresty/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binDAEMON=/usr/local/openresty/nginx/sbin/nginx 

现在当你运行 sudo service nginx start/stop/restart 时,它会调用 openresty 文件夹中的 nginx.conf 文件。而/usr/local/openresty是默认安装Openresty的路径

关于nginx - 运行 service start/stop/restart nginx 命令时调用 openresty 的 nginx.conf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20418113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com