[GH-ISSUE #1236] Alpine Linux 中 nginx.conf 配置识别有误 #674

Closed
opened 2026-02-26 12:09:07 +03:00 by kerem · 4 comments
Owner

Originally created by @LogicDX342 on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1236

环境为 Alpine 3.22

nginx 的 默认配置文件 中,已有位于根层级的 include /etc/nginx/conf.d/*.conf;,但 nginx-ui 依然会报错 Nginx conf not include conf.d directory

点击自动修复,nginx-ui 会在 http 块中增加这行配置,导致 conf.d 中不应在 http 块中的配置文件报错,比如 nginx-mod-stream 中的 stream.conf 文件, 以及 nginx-ui 自己生成的 stub_status.conf

Originally created by @LogicDX342 on GitHub (Jul 16, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1236 环境为 Alpine 3.22 nginx 的 [默认配置文件](https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/nginx/nginx.conf) 中,已有位于根层级的 ```include /etc/nginx/conf.d/*.conf;```,但 nginx-ui 依然会报错 ```Nginx conf not include conf.d directory```。 点击自动修复,nginx-ui 会在 ```http``` 块中增加这行配置,导致 ```conf.d``` 中不应在 ```http``` 块中的配置文件报错,比如 [nginx-mod-stream](https://pkgs.alpinelinux.org/package/edge/main/x86/nginx-mod-stream) 中的 ```stream.conf``` 文件, 以及 nginx-ui 自己生成的 ```stub_status.conf```
kerem 2026-02-26 12:09:07 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Jul 16, 2025):

抱歉,我们的设计是 include /etc/nginx/conf.d/*.conf; 应该位于 server {} block 中

<!-- gh-comment-id:3078661972 --> @0xJacky commented on GitHub (Jul 16, 2025): 抱歉,我们的设计是 include /etc/nginx/conf.d/*.conf; 应该位于 server {} block 中
Author
Owner

@LogicDX342 commented on GitHub (Jul 16, 2025):

请问目前有打算做兼容吗

<!-- gh-comment-id:3078691792 --> @LogicDX342 commented on GitHub (Jul 16, 2025): 请问目前有打算做兼容吗
Author
Owner

@0xJacky commented on GitHub (Jul 16, 2025):

请问目前有打算做兼容吗

没有这个打算,因为 debian 默认的标准就是放在 server block 中的

<!-- gh-comment-id:3078704313 --> @0xJacky commented on GitHub (Jul 16, 2025): > 请问目前有打算做兼容吗 没有这个打算,因为 debian 默认的标准就是放在 server block 中的
Author
Owner

@LogicDX342 commented on GitHub (Jul 16, 2025):

ok,那我手改一下吧

<!-- gh-comment-id:3078736861 --> @LogicDX342 commented on GitHub (Jul 16, 2025): ok,那我手改一下吧
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#674
No description provided.