Placeholders are not replaced on On-Demand-TLS Ask URL #3922
Labels
Milestone
Comments
|
You should instead be using the https://caddyserver.com/docs/caddyfile/concepts#environment-variables That said, for JSON config users, it still probably makes sense to support this anyways. As an aside, |
|
@francislavoie Thanks for the tip! I really did miss the point regarding the variable replacement at parse time vs runtime. Everything works now as expected. Would you like to keep this issue open for the JSON config users? |
|
I'd like to work on this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


I am trying to build a Caddy configuration that can cater to multiple environments (production, staging, local development).
To achieve this, I want to use environment variables for the base host names/urls, via the
{env.*}placeholder. This works great in addresses, route matches and upstream reverse-proxy configuration.Unfortunately, using the same approach does currently not work when using On-Demand-TLS with the
askproperty because the placeholder is not replaced at runtime:Here's the relevant part of the config:
The text was updated successfully, but these errors were encountered: