Is it possible to loop over an array in a Caddyfile

215 Views Asked by At

I have a Caddyfile which I have a CORS function defined:

(cors) {
    @origin{args.0} header Origin {args.0}
    header @origin{args.0} Access-Control-Allow-Origin "{args.0}"
    header @origin{args.0} Vary Origin
}

and then currently I have:

import cors {$CORS_ALLOWED_ORIGIN}

However, I really need to iterate over an environment variable which is an array of domains.

Is that possible to loop/iterate in a Caddyfile?

0

There are 0 best solutions below