docs
docs copied to clipboard
Add Discovery Server reverse proxy guide for Caddy
The reverse proxy section of Syncthing Discovery Server has no guide on setting it up with Caddy (v2). I can't for the life of me figure out how to make it work.
Hi Corey,
as you might have seen in the caddy issue https://github.com/caddyserver/caddy/issues/3767, reverse proxying with caddy is, at the time I'm writing this, NOT possible due to a missing feature for passing a client certificate via a header (see linked issue).
And as mentioned in the linked issue aswell, I solved the issue myself by adding the missing feature (see commit https://github.com/mc0239/caddy/commit/df63c2d78fc3c2d6daf5ccf8c42a4dc4cc1f4572) and building the caddy binary myself.
With my own caddy binary, my Caddyfile
configuration looks as follows:
mydiscosrv.example.com {
reverse_proxy 127.0.0.1:8443 {
header_up X-Forwarded-For {http.request.remote.host}
header_up X-Client-Port {http.request.remote.port}
header_up X-SSL-Cert {http.request.tls.client.certificate_pem_escaped} # this is not (yet) supported in caddy v2!
}
tls {
client_auth {
mode request
}
}
}
It's fixed now. caddyserver/caddy#4241
I have added a PR for the docs here: https://github.com/syncthing/docs/pull/812