Skip to content

Fix nginx security bugs in DDEV config - #4270

Merged
admdly merged 2 commits into
mainfrom
claude/fossbilling-nginx-docs-997be8
Sep 2, 2026
Merged

Fix nginx security bugs in DDEV config#4270
admdly merged 2 commits into
mainfrom
claude/fossbilling-nginx-docs-997be8

Conversation

@admdly

@admdly admdly commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

Fixes three real nginx bugs in the DDEV local-dev config (.ddev/nginx_full/fossbilling.dev.conf).

Bugs fixed

  • Missing $ anchor on the PHP entry-point allow-list. location ~ ^/(index.php|ipn.php|install/index.php|install/install.php) prefix-matched instead of requiring an exact filename.
  • Unescaped leading dots in both PHP-related regexes (. matches any character, not just a literal dot), including the final .(php)$ deny-all rule.
  • yam typo in the sensitive-extension list — .yaml/.yml files were never actually blocked, despite the rule's intent.
  • No protection for composer.json/README.md/CHANGELOG.md, unlike src/.htaccess, which blocks these explicitly. Added a matching rule (merged into the existing sensitive-files location via regex alternation rather than a separate block, since that's how .htaccess treats it — one combined check).

- location ~ ^/(index.php|ipn.php|install/index.php|install/install.php)
  had no trailing $, so it prefix-matched instead of requiring an exact
  entry-point filename.
- Both PHP-related regexes had an unescaped leading dot (`.` matches any
  character, not just a literal dot), including the final catch-all
  `.(php)$` deny rule.
- The sensitive-file extension list had `yam` instead of `yaml`/`yml`,
  so those extensions were never actually blocked.
- No protection at all for composer.json/README.md/CHANGELOG.md, unlike
  src/.htaccess, which blocks these explicitly.

Verified against the real file with an isolated nginx+php-fpm harness
before and after: confirmed config.yaml, composer.json, and README.md
were served as static 200s pre-fix and are 403 post-fix, confirmed
routing (front-controller path resolution, query strings, all four
real entry points) is unaffected, and confirmed `nginx -t` passes on
the file as committed.
@admdly admdly self-assigned this Sep 2, 2026
@admdly

admdly commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6db3a175-b477-4a56-bae4-e5377c69f59e

📥 Commits

Reviewing files that changed from the base of the PR and between c8439d0 and fd9ebb6.

📒 Files selected for processing (1)
  • .ddev/nginx_full/fossbilling.dev.conf

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved web server path matching to more reliably protect sensitive files.
    • Tightened PHP request handling to prevent unintended path matches.

Walkthrough

The nginx development configuration tightens regex matching for sensitive files and PHP paths. It adds YAML, Composer, README, and changelog patterns, escapes literal dots, and anchors exact PHP path matches.

Changes

Nginx Regex Hardening

Layer / File(s) Summary
Tighten nginx path matching
.ddev/nginx_full/fossbilling.dev.conf
The sensitive-file rule matches YAML and selected project files. PHP route patterns escape literal dots and require exact path endings.

Merge Risk: ⚪ Minimal · up to fd9eb

This localized nginx configuration update addresses the listed filename-matching and sensitive-file protection issues without any identified merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing nginx security bugs in the DDEV configuration.
Description check ✅ Passed The description directly explains the nginx security issues addressed, the regex changes, and the protected files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@admdly
admdly merged commit 409a867 into main Sep 2, 2026
52 checks passed
@admdly
admdly deleted the claude/fossbilling-nginx-docs-997be8 branch September 2, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant