Use wildcard Host matchers instead of HostRegexp#933
Open
mikelittle wants to merge 1 commit into
Open
Conversation
Traefik 3.7 introduced single-level wildcard subdomain matching for the Host matcher (e.g. Host(`*.example.com`)). Use it in place of the HostRegexp(`^[A-Za-z0-9-]+\.example\.com$`) pattern that was constructed in get_primary_host_rule() and get_s3_client_host_rule(). The nodejs router rule, which already contained no regex metacharacters, is also switched from HostRegexp(`nodejs-...`) to Host(`nodejs-...`). Behavioral notes: - The wildcard accepts any DNS-valid label, whereas the prior regex required [A-Za-z0-9-]+. For local dev hostnames this is a deliberate relaxation. - TLSOptions can be associated with wildcard Host matchers but not with HostRegexp, so this also unblocks per-domain TLS option work in the future. Requires Traefik >= 3.7 (see proxy.yml bump). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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
Replaces
HostRegexproute rules inDocker_Compose_Generatorwith Traefik 3.7's single-level wildcardHostmatcher:get_primary_host_rule()—HostRegexp(\^[A-Za-z0-9-]+.$`)→Host(`*.`)`, for the primary domain and every extra domain.get_s3_client_host_rule()— same swap for the S3 client subdomain rule.HostRegexp(\nodejs-`)(no regex metacharacters) →Host(`nodejs-`)`.Why:
Hostmatchers, but not withHostRegexp(per the 3.7 migration notes). This unblocks per-domain TLS options in the future.Behavior note: the wildcard accepts any DNS-valid label, while the old regex required
[A-Za-z0-9-]+. For local dev hostnames this is a deliberate relaxation, not a regression.Dependencies
Requires Traefik ≥ 3.7. Merge #932 first (or merge them together).
Test plan
<project>.altis.dev) still resolves.sub.<project>.altis.dev) still resolves.extra_domainsconfigured inlocal-serverconfig still resolve at both bare and subdomain levels./uploads/...(S3 client routing) still works via Tachyon and direct.nodejs-<project>.altis.dev) routes correctly.🤖 Generated with Claude Code