fix(nginx-proxy)!: apply wildcard htpasswd and ACL only to *.X hosts - #354
Merged
mrrobot47 merged 2 commits intoSep 25, 2026
Merged
Conversation
The wildcard lookup counted labels on the host instead of matching the site, so a subsite of a 4+ label subdomain multisite (*.ms.dev.example.com) never found _wildcard.ms.dev.example.com, while an unrelated site like shop.example.com picked up _wildcard.example.com and demanded another site's credentials. A _wildcard.X file now applies only to a host that is literally *.X; every other host uses its exact file or falls back to default. The ACL include uses the same mapping (vhost.d/_wildcard.X_acl for *.X hosts), including the mailhog and /ee-admin/ locations, so per-site IP whitelists also apply to subdomain hosts. BREAKING CHANGE: _wildcard.X now applies only to the literal *.X host, no longer to X itself, which needs its own exact htpasswd/X (and vhost.d/X_acl) file. The label-counting fallback from EasyEngine#298 (checking _wildcard.<last 3 labels>, then _wildcard.<last 2 labels>, for multi-level TLDs) is gone, so setups that relied on it to protect other hosts must add exact files for them.
This was referenced Sep 24, 2026
Merged
mrrobot47
marked this pull request as ready for review
September 25, 2026 05:13
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The wildcard htpasswd lookup added in #298 counted labels on the host instead of matching the site. A subsite of a subdomain multisite with 4+ labels (
*.ms.dev.example.com) never found_wildcard.ms.dev.example.com, while an unrelated site likeshop.example.compicked up_wildcard.example.comand asked for another site's credentials.A
_wildcard.Xfile now applies only to the literal*.Xhost. Every other host uses its exact file or falls back todefault.Changes
nginx.tmpl: the htpasswd lookup is exact host →_wildcard.Xfor a*.Xhost →default. The label-counting fallback is removed.nginx.tmpl: the ACL include uses the same mapping (vhost.d/_wildcard.X_aclfor*.Xhosts) through oneacltemplate, also for the mailhog and/ee-admin/locations, so per-site IP whitelists apply to subdomain hosts too.README.md: describes the*.X-only lookup and the file names.Breaking change:
_wildcard.Xno longer applies toXitself, which needs its ownhtpasswd/X(andvhost.d/X_acl) file. Setups that relied on the #298 fallback (_wildcard.<last 3 labels>, then_wildcard.<last 2 labels>) to protect other hosts must add exact files for them. auth-command (EasyEngine/auth-command#57) writes the file each served host needs, and its upgrade migration regenerates them.Release / merge order
These PRs ship together in one core release:
easyengine/nginx-proxytemplate (needs a new dockerfiles tag)Order:
easyengine/nginx-proxyimage is on Docker Hub.dev-developof every package) and tag each package.easyengine/nginx-proxyinimg-versions.jsontogether.Why they are coupled:
_wildcard.Xfile to sibling sites too (e.g.shop.example.compicks up_wildcard.example.com).site_alias_domains_before_update,site_alias_domains_updatedandsite_alias_domains_update_failedhooks, which only the new site-command fires.site_cleanuphook (autoloaded since feat(auth): support http auth and ip whitelist on wildcard subdomains and alias domains auth-command#57) does it.split_alias_domains()andvalidate_alias_domains(); with an older site-command, site create fails with a fatal "undefined function" error._wildcard.Xfiles that were also relied on to protectXitself:Xnow needs its ownhtpasswd/X(andvhost.d/X_acl) file.Testing
*.aliases, multiple users, global auth, IP whitelists, alias add/remove, site delete, self-signed SSL and Let's Encrypt.