Domain Matching
Configure domain matching for GoDoxy
An alias can be:
- a short alias like
app - an FQDN (Fully Qualified Domain Name) alias like
app.example.com - a leading-label wildcard alias like
*.example.com
Docker
By default, the container name is used as the short alias unless proxy.aliases is set.
General
Without match_domains
If match_domains is not set in config.yml, below will match route with short alias app:
app.anydomain.comapp.*.anydomain.com- ...
Below will match route with FQDN alias app.example.com:
app.example.comapp.example.com.*
Below will match route with wildcard alias *.example.com:
foo.example.combar.example.com
And will not match:
example.comfoo.bar.example.com
Using match_domains
Use this to restrict which base domains are valid.
With match_domains in config.yml:
match_domains:
- example.com
- example.orgThen a short alias app can be accessed only at:
app.example.comapp.example.org
And a route with FQDN alias app.example.com can be accessed at:
app.example.com
And a wildcard alias *.example.com can be accessed only at one-label subdomains such as:
foo.example.combar.example.com
but not:
foo.bar.example.com
Priority
Host resolution order is:
- existing exact/FQDN or short-alias domain match
- wildcard alias fallback
This keeps normal exact-route matching fast while still allowing wildcard aliases.
Route file example
Quote wildcard aliases in YAML route files:
"*.example.com":
host: 10.0.0.20
port: 8080Use case example for match_domains
Given your main domain is my.app:
-
Add
my.apptoautocert.domainsandmatch_domainsinconfig.yml.autocert: domains: - my.app match_domains: - my.app -
Use short aliases like
adguardandsonarrwhen you want them accessible under your main domain.services: adguard: # adguard.my.app ... labels: proxy.aliases: adguard sonarr: # sonarr.my.app ... labels: proxy.aliases: sonarr -
Use FQDN aliases like
adguard.other.appandsonarr.other.appwhen you want them accessible under other domains.# docker compose services: adguard: ... labels: proxy.aliases: adguard.other.app sonarr: ... labels: proxy.aliases: sonarr.other.app # config.yml autocert: domains: - my.app