Recent Discussions

Setting up a reverse proxy with a VPS + Caddy + Cloudflared

Unanswered
Palomino posted this in #questions
Messages457 messages
Views0 views
PalominoOP
I am currently trying to setup a reverse proxy with my VPS using caddy, and a cloudflare tunnel to connect that with my local LAN. I have 2 whole issues:

1. Caddy is weird to work with, idk if I am doing something wrong. I setup the VPS's side to have the following Caddyfile:
*.example.com {
            reverse_proxy localhost:80
}

and the local server has
play.example.com { reverse_proxy localhost:25565 }
foundry.example.com { reverse_proxy localhost:30000 }


2. I have no idea how to reliably troubleshoot this, how can I check this stuff?

Thanks!
Yakutian Laika
@Palomino I am unsure that caddy can do this
normal caddy is for https and doesnt do tcp for minecraft
(from what im seein)
@Yakutian Laika normal caddy is for https and doesnt do tcp for minecraft
Connecticut Warbler
Caddy has a l4 module
With haproxy protocol etc support, pretty neat
Bluetick Coonhound
Why did nobody suggest velocity to this man
Connecticut Warbler
I mean that too
@Connecticut Warbler Cloudflared wont work with mc, make sure you have a l4 caddy build
Polish
Technically, you can use CF ZeroTrust with warp/cloudflared on both devices, I believe?
Which supports arbitrary tcp tunneling
@Polish Technically, you can use CF ZeroTrust with warp/cloudflared on both devices, I believe?
Connecticut Warbler
Im basing off more info he gave in general
Polish
The fact he's proxying to localhost with caddy on both sides makes me believe he is using cloudflared on both sides, but that's maybe an assumption
@Polish Technically, you can use CF ZeroTrust with warp/cloudflared on both devices, I believe?
Connecticut Warbler
Oh you would do velocity cf for tunnel between the two machines?
Interesting, although could potentially add more latency if there isnt a as close cf dc
Polish
I wouldn't recommend it, and you're probably better doing the same over a SSH tunnel imho
But it is doable
Connecticut Warbler
Bc it would be, his pc _> cf - > vps - > cf - > pc
But ye in that sense
Thought you wanted the players
Polish
I think it's more like:
VPS <-> cloudflared <-tunnel-> cloudflare <-> tunnel <-> cloudflared <-> home server
So people could connect to the VPS as an external IP and still reach his home server, without personally needing cloudflared/warp installed
(mostly to get around CGNAT I assume)
@Polish I think it's more like:
VPS <-> cloudflared <-tunnel-> cloudflare <-> tunnel <-> cloudflared <-> home server
Connecticut Warbler
Thats what i was trying to type, mobile and swiftkey
Polish
Could maybe reduce the latency as cloudflared/warp supports warp to warp routing (p2p), so effectively only using CF to holepunch through NAT
(basically replicating how tailscale works)
Loading...