Wildcards in directives?

6. Links to relevant resources:


Can a wildcard be used as the path for an internal directive (or directives in general)?


internal .*

to mark all files starting with a dot as internal?

I think you would do internal /.

I highly recommend you try Caddy v2 though, Caddy v1 is no longer actively supported (only critical bug fixes).

It seems like this is not supported. A more important question has arisen though:

Do internal and proxy interfere with one another in any documented way? I successfully added my internal directive to the individual files that needed to be un-served, but now my proxy directives don’t work:

domain.com {

  proxy /db localhost:5984 {
    without /db

  proxy /api localhost:3000 {
    without /api

  internal .env.production.local
  internal .env.development.local

www.domain.com {
  redir https://domain.com{uri}

db.domain.com {
  proxy / localhost:5984 

Requests to domain.com/db now return 500 - Internal Server Error.

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