Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Discovery Server reverse proxy guide for Caddy #631

Open
Corey-Keller opened this issue Apr 6, 2021 · 3 comments
Open

Add Discovery Server reverse proxy guide for Caddy #631

Corey-Keller opened this issue Apr 6, 2021 · 3 comments

Comments

@Corey-Keller
Copy link

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.

@mcebular
Copy link

mcebular commented Apr 7, 2021

Hi Corey,

as you might have seen in the caddy issue caddyserver/caddy#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 mcebular/caddy@df63c2d) 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
		}
	}
}

@aoxiangtianji
Copy link

It's fixed now.
caddyserver/caddy#4241

@MrOggy85
Copy link
Contributor

MrOggy85 commented Aug 1, 2023

I have added a PR for the docs here: #812

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants