basecamp / kamal-proxy

Lightweight proxy server for Kamal
https://kamal-deploy.org/
MIT License
754 stars 31 forks source link

Allow routing to wildcard subdomains #45

Closed kevinmcconnell closed 1 month ago

kevinmcconnell commented 1 month ago

This allows routing to wildcard subdomains by specifying a host like:

--host=*.example.com

This matches requests to hosts with any subdomain in place of the *. It does not match multiple levels of subdomain to a single *, nor are multiple * allowed in a single host. Rather it behaves much like the wildcard matching in TLS certificates does.

Automatic TLS is not currently supported with wildcard hosts (because the challenge types we use -- http-01 and tls-alpn-01 -- can't be used to generate wildcard certificates). However you can bring your own wildcard certificates using --tls-certificate-path / --tls-private-key-path.

cc @djmb

Closes #30