Global named matcher

Hi there,

This is just a question. I come from Caddy v1 and migrating to Caddy v2 and couldn’t find in the docs. If I did not search correctly, sorry. I like the concept of named matchers but was wondering if it is possible to have global ones.

I have a Caddyfile dealing with multiple subdomains and I have named matchers that I repeat for every one of them. Is there a way to make them global instead of local to the subdomain so that in the config bloc of every subdomain I can just call them instead of having to redefine them first.

Thanks in advance

There’s no way to globally define a matcher, but you can use snippets to reuse common bits of your config, including matchers.

1 Like

Hi Francis,

Thank you again for your support, it’s exactly what I was looking for. Sorry for not being able to find it directly in the documentation in the first place.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.