I’m not posting a bunch of config files, but only because everything works fine. I have no errors, I just don’t think the docs for this exist yet.
1. Caddy version (caddy version
):
2.2.1
2. How I run Caddy:
A service on the digital ocean marketplace droplet template. I use the admin api to create and manage reverse proxies just fine.
a. System environment:
Ubuntu 18, running as a service (the one that’s installed on the digital ocean marketplace droplet)
b. Command:
I don’t, I use the service that starts itself. It uses the resume feature.
c. Service/unit/compose file:
This all works fine, I’ll post it later if needed.
d. My complete Caddyfile or JSON config:
Here’s an example of what I send to the admin API (anything in #{} is replaced with a value by my app, works fine as is):
{
"@id": "vhost_#{vhost.id}",
"match": [
{
"host": [
"#{vhost.incoming_address}"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "#{vhost.target_address}:#{port}"
}
]
}
]
}
]
}
],
"terminal": true
}
3. The problem I’m having:
I just want to know how to format my json request to add a X-Forwarded-Proto https header, so that my backend app knows and doesn’t try to redirect.
4. Error messages and/or full log output:
No errors
5. What I already tried:
I haven’t tried anything yet because I can’t find any docs on how to format this. I could do it with directives in a caddyfile, but my use case requires the admin API. The docs are just missing this info.
6. Links to relevant resources:
None, can’t find any docs.