Wildcards in directives?

6. Links to relevant resources:

https://caddyserver.com/v1/docs/internal

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

eg:

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 {
  minify
  #gzip

  proxy /db localhost:5984 {
    transparent
    without /db
  }

  proxy /api localhost:3000 {
    transparent
    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.