gpt4 book ai didi

配置文件路径的nginx变量

转载 作者:行者123 更新时间:2023-12-03 15:00:56 24 4
gpt4 key购买 nike

例如,有没有办法指定 root应该相对于配置文件所在的目录?就像是

root $conf_path/www

最佳答案

您实际上可以使用 -p 来做到这一点。选项。

如果您的配置文件与您的应用程序位于同一目录中,则可以运行:

/your/folder $ sudo nginx -c `pwd`/nginx.conf -p "`pwd`"

从您的应用程序文件夹。
您的 nginx.conf文件更改自:
http {
include mime.types;
root /your/folder;
server {
listen 8000;
}
}


http {
include /etc/nginx/mime.types;
root .;
server {
listen 8000;
}
}

只需确保检查指向 /etc/nginx/ 的相关链接即可。

关于配置文件路径的nginx变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16865196/

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