Wildcard Domain Names

I am looking to recreate our current local development setup from Nginx where we specify different subdomains for a domain name that could potentially change.

We have virtual hosts similar to the following:
server { … }
server foo.
server bar.* {…}

Can Caddy accomodate such a structure?

No, Caddy tries to follow RFC 6125 here, whereby only left-most labels are matched for wildcards. This is because Caddy also manages the certificates based on these hostnames. We could look into loosening this but we’d have to vet it thoroughly because it’s such a critical part of what Caddy does.

This is a very strange need, though. What is your use case?

@matt This is for a local development environment where the actual domain name could be anything.

Have you tried switching the order around? (Seriously.)

My apologies, I do not understand your response. Switch what around?

Instead of foo.*, do *.foo. Wildcard domain names are designed that way for hierarchal reasons.

That is not possible given the requirements for this project.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.