mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #1149] nginx配置中使用include /www/nginx/xx.conf 后台会去/etc/nginx查找文件并报错 #624
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#624
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @myjscdn on GitHub (Jun 16, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1149
我在nginx配置中添加自定义文件,include /www/nginx/xx.conf ,正常来说是直接加载/www/nginx/xx.conf的文件,但是后台不停的提示/etc/nginx/www/nginx/xx.conf不存在,这是什么原因。
@0xJacky commented on GitHub (Jun 16, 2025):
这是 nginx 的问题吧,你试试 nginx -t 能过 nginx 的自检查吗
不过 nginx-ui 为了安全考量,会限制只打开 nginx 配置文件目录(如 /etc/nginx)下的文件
由于你没有提交截图、终端输出和错误信息,我无法判断问题来源于哪里
@myjscdn commented on GitHub (Jun 18, 2025):
就像图片里面显示的,我include站点下的nginx配置,会一直提示/etc/nginx/文件夹下找不到文件, nginx -t 是能过自检的,而且启用之后规则也生效了,就是后台不停的弹出/etc/nginx/文件夹下找不到文件,时间长了docker会假死 无法连接,需要重启。
另外问一下,面板如何指定通过特定域名才能访问,而不是输入IP就直接进去了。
@0xJacky commented on GitHub (Jun 18, 2025):
明白了,这个确实是 nginx-ui 的安全限制部分,现阶段您可以将 c.baidu.com/nginx.conf 的配置文件移动到 /etc/nginx 下,并修改 include,至于 「时间长了docker会假死 无法连接,需要重启」,这个我们需要看看才能回复。
另外问一下,面板如何指定通过特定域名才能访问,而不是输入IP就直接进去了。
这个可以修改 /etc/nginx/conf.d/nginx-ui.conf 中的配置文件内容,限制 server_name.
@Lawlietr commented on GitHub (Jun 18, 2025):
這個問題我貌似也有遇到,不過我是重啟 systemd
後來發現 nginx-ui 實際上沒假死,只是突然 cpu 使用率升高
前台不回應,等個一分鐘後 cpu 使用率下降,又像沒事一樣可以正常訪問
我查過 syslog,沒看到任何異常訊息
nginx-ui 異常的時候,nginx 服務正常工作
這類問題通常發生在你每天第一次開啟的時候