Need help setting up caddy as reverse proxy for remote desktop services gateway

I am trying to setup caddy as a remote proxy for windows remote desktop services gateway. The gateway itself works okay without the proxy, so it is setup properly.

remote.example.net:443 {
	proxy / 192.168.0.10:443 {
		transparent
		header_upstream Host {host}
		header_upstream X-Real-IP {remote}
		header_upstream X-Forwarded-For {host}
		header_upstream X-Forwarded-Proto {scheme}
	}
	tls mail@gmail.com
	log access_remote.example.net.log {
		rotate {
			size 100
			age  14
			keep 10
		}
	}
}

I dug around and it looks like it may have something to do with page at https://192.168.0.10/rpc
Without reverse proxy basic auth window is returned, but with caddy nothing is shown except 502 after 60 seconds.

If Caddy’s proxy detects that an upstream is down (error response code) then it will treat it as down for 60s (this is documented). It’s probably doing that because, until authenticated, the server returns an error response code.

You can change how long to consider a server down, although setting it to 0 can have some strange side effects. Still looking into a better way to handle this.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.