[FEAT] Default site returns 200 for unknown paths, so nginx-botsearch never matches
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start by locating the sample default.conf and inspect its try_files directive. Check how the default site serves / and whether the proposed =404 fallback preserves that behavior. Done when unknown paths return 404 while / still serves the landing page; the issue does not name a test, so verify both cases against the sample configuration.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Dockerfile
- Stars
- 3.8k
- Forks
- 276
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxserver/docker-swag
-
[BUG] Nginx keeps serving the self-signed certificate after the first validation when VALIDATION=httpPossibly taken @atsidaev claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
linuxserver/docker-swag#638 · 4 comments ·
-
Difficulty 4/5 1-2 days Newbie friendliness 25/100
linuxserver/docker-swag#636 · 1 comment ·
-
[BUG] Anonymous Authelia redirects can overwrite a newer login sessionPossibly taken @MeiXu6693 claimed this 33 days ago. Openno-issue-activity
Difficulty 3/5 1-2 days Newbie friendliness 48/100
linuxserver/docker-swag#634 · 2 comments ·
-
no-issue-activity
Difficulty 4/5 1-2 days Newbie friendliness 25/100
linuxserver/docker-swag#630 · 3 comments ·
-
[BUG] "chmod: changing permissions of '/XXX': Bad address" error message (QNAP)May be free again A pull request for this issue was closed without being merged. Openbug upstream issue work-in-progress
Difficulty 4/5 3-5 days Newbie friendliness 45/100
linuxserver/docker-swag#514 · 75 comments ·
All issues in linuxserver/docker-swag
Similar issues
-
canary-dead
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
activescott/home-infra-k8s-flux#578 ·
Maintainers usually reply within 1 day
-
repo-harnesses: the entrypoint-guard check greps a message `#13692` reworded, so it fails on mainOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
daniel-ospina/tortoise#14947 ·
Maintainers usually reply within 1 day
-
area: infra tier: p3 type: chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flashinfer-ai/flashinfer#10251 ·
Maintainers usually reply within 1 day