this post was submitted on 15 Jul 2025
31 points (100.0% liked)

Selfhosted

60210 readers
1080 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

Let's say I setup some subdomains and then point them to my home server via Cloudflare tunnel.

If I use one of those subdomains from my personal PC on the same network as my home server, to watch a movie for example, is all of that traffic going out to the internet and then back? Or does all the traffic stay internal once the connection has been made?

you are viewing a single comment's thread
view the rest of the comments
[–] sk@utsukta.org 7 points 11 months ago (1 children)

yes, its also called hairpinning. to avoid this you can use a local dns resolver.

[–] aksdb@lemmy.world 5 points 11 months ago (2 children)

Cloudflare tunnel likely terminates TLS on the edge. So if you bypass it, you don't have HTTPS. Not a problem locally, but then destroys the portability of the URL (because at home you need http and outside you need https). Might as well use different hosts then.

[–] AmbiguousProps@lemmy.today 6 points 11 months ago (1 children)

You can use caddy to get internal https via cloudflare API, and no traffic needs to go through a cloudflare tunnel for that.

[–] aksdb@lemmy.world 2 points 11 months ago (1 children)

Possible, true. But then the setup also becomes more complicated. In addition you end up with different certs for local and remote access, which could cause issues with clients if they try to enforce cert pinning for example.

[–] AmbiguousProps@lemmy.today 4 points 11 months ago

The (wildcard) certs are the same, as it's what caddy is pulling via API. You can either build the cloudflare module into caddy via docker build, or use a prebuilt version. It doesn't create two separate certs for local and remote.

It works really well for me, and is actually the most straight forward way to get valid certs for internal services I've found. Since they're wildcard, my internal domains don't get exposed through certificate authorities.

[–] sk@utsukta.org 0 points 11 months ago (1 children)

what if I use a separate proxy service locally with a cert and the same domain?

[–] aksdb@lemmy.world 1 points 11 months ago (1 children)

If your client(s) accept irregularly changing remote certs (i.e. they don't do cert pinning), it should work. If both cloudflare and you use the same CA, it would likely work even with cert pinning. Certainly possible, but increases the complexity of the overall setup.

[–] SteveTech@programming.dev 1 points 11 months ago

Cert pinning is pretty uncommon in the self hosting community though, especially when both Cloudflare and Let's Encrypt have a 90 day validity period and often renews after 60 days.