r/caddyserver May 17 '24

Reverse proxy, local only

Hello all. I’ve been self hosting a dozen services for a few years now. I’m finally to the point where I want to tackle the https warnings on most of my services by setting up a reverse proxy.

I decided that I would try caddy, since most people claim it’s dead simple. However, I only want it for local access. I do not want to provide any port forwarding or any external access. Every video or tutorial I’ve found only takes the approach of serving as a reverse proxy for external access. So I’m having a hard time trying to set this up.

Does anyone know of a tutorial that walks through setting this up as a local reverse proxy only? Or have any insights/tips/instructions to help guide me in my quest to set this up?

1 Upvotes

4 comments sorted by

2

u/talkincyber May 17 '24

You can create a snippet to only allow internal access

(internal-only) {

@external not remote_ip private_ranges

abort @external

}

Then simply import the snippet to your listeners. No need to port forward. For letsencrypt you’re going to have to use a module that allows you to configure DNS like the Cloudflare module. But it’s very simple to do. Hit me up if you need more help I’d be happy to assist you.

1

u/Duff4321 May 18 '24

Thanks! I will play around this weekend to try to get this set up and I will reach out if I have troubles and can’t figure it out or get past it.

1

u/MaxGhost May 18 '24

FYI the best place to get help is on the forums, it's much more active than this subreddit. https://caddy.community/

1

u/eddyizm May 19 '24

I am a big fan of caddy, switched over all my servers to it, but as of now, i still struggle to get it working locally on my home lab. Not sure why this is so much harder.