[FEAT] Default site returns 200 for unknown paths, so nginx-botsearch never matches
还没有人认领这个 Issue。
评估
调研方向
首先找到示例配置 default.conf,并检查其中的 try_files 指令。检查默认站点如何提供 /,以及建议的 =404 回退是否保留该行为。未知路径返回 404 且 / 仍提供着陆页时即告完成;issue 未指定测试,因此请根据示例配置验证这两种情况。
由索引模型根据 Issue 内容生成。
描述
Is this a new feature request?
- I have searched the existing issues
Wanted change
Hi,
the default site should return 404 for paths that don't exist. Right now it falls back to /index.html and returns 200 for everything.
Reason for change
I wondered why fail2ban never banned the scanners hitting my server. The nginx-botsearch jail only matches requests with a 404:
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) \/<block> \S+\" 404 .+$
But the default site has
try_files $uri $uri/ /index.html /index.htm /index.php$is_args$args;
so every unknown path gets the landing page with 200:
"GET /.ssh/id_rsa HTTP/1.1" 200 1345 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
"GET /%2egitconfig HTTP/2.0" 200 1345 "-" "curl/8.7.1"
In my access log that happened 5282 times, and the jail matched only 21 of 373440 lines. My default.conf is the unchanged sample (2026/03/07).
Proposed code change
try_files $uri $uri/ =404;
/ still shows the index.html. If the fallback is there on purpose (php apps in /config/www), maybe add a comment in the sample that nginx-botsearch doesn't work for the default site then.
- 主要语言
- Dockerfile
- 星标
- 3.8k
- 派生
- 274
- 平均合并
- 25 分钟
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxserver/docker-swag 的其他 Issue
-
难度 4/5 1-2 天 新手友好度 25/100
linuxserver/docker-swag#636 · 1 条评论 ·
-
[BUG] Anonymous Authelia redirects can overwrite a newer login session可能已有人在做 @MeiXu6693 于 21 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 48/100
linuxserver/docker-swag#634 · 1 条评论 ·
-
no-issue-activity
难度 4/5 1-2 天 新手友好度 25/100
linuxserver/docker-swag#630 · 3 条评论 ·
-
[BUG] "chmod: changing permissions of '/XXX': Bad address" error message (QNAP)可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug upstream issue work-in-progress
难度 4/5 3-5 天 新手友好度 45/100
linuxserver/docker-swag#514 · 75 条评论 ·
-
awaiting-approval
难度 4/5 3-5 天 新手友好度 38/100
linuxserver/docker-swag#276 · 7 条评论 · 6 个 reaction ·
查看 linuxserver/docker-swag 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 74/100
melodic-software/claude-code-plugins#17374 · 2 条评论 ·
维护者通常 1 天内回复
-
area: doc-engine area: infrastructure bug community-request
难度 2/5 1-3 小时 新手友好度 75/100
snapotter-hq/SnapOtter#4834 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 73/100
soroswap/token-list#125 ·
维护者通常 1 天内回复