Caddy CORS is built to allow easy control over cross origin resource sharing from your Caddy configuration. It based off of the cors module created by captncraig.
cors [<matcher>] [allowed_origins: []string] {
override_existing_cors: bool
allowed_methods: []string
allow_credentials: bool
max_age: int
allowed_headers: []string
exposed_headers: []string
}
These are the default values of the Cors directive if left unset.
- path: "/"
- allowed_origins: "*"
- override_existing_cors: false
- allowed_methods: "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"
- allow_credentials: false
- max_age: 5 seconds
- allowed_headers: empty
- exposed_headers: empty
Install instructions here
Usage instructions here
Example caddyfile here