I know that I can use 3rd party services to set up a tunnel, like Cloudflare, but I’d like to implement this myself.
I feel like every time I research this question I find all kinds of blogs / form posts across the timescape on the topic, and I’m just looking for whatever might be the most current or recommended best method of configuring a VPS tunnel. I’m behind a CG-Nat which is why I want to set one up.
If you’ve done this recently yourself, where did you get your info from?
Thanks!
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:
Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.
No spam posting.
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.
Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
No trolling.
Resources:
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
Doesn’t have to be a subdomain, but just good practice for hostnames to be a subdomain because hostnames generally represents a named server (subdomain) within an organization (domain). Also it makes things easier if you add additional servers in the future to just assign another hostname to the new server.
I usually do:
domain.ext
- leave open, not used.servername.domain.ext
- A records in DNS pointing to servers’ public addresses; (i.e.servera.domain.ext. A 10.0.0.123
;serverb.domain.ext. A 10.0.0.234
; etc.)service.domain.ext
- CNAME to the server it is on (i.e.auth.domain.ext. CNAME servera.domain.ext
This way it is super quick for me to move entire server to different provider (update A record) or move service to another server (update CNAME record) when I need to shuffle things around.
If you’re running a public facing website, you could always CNAME your
www
and@
(or whatever your DNS provider uses to represent root domain) to your server specific A record entry.It’s funny, when you explain it, my IT hat goes on and I totally get it lol. I guess the context felt different enough that I didn’t get it. But I work with Windows domains all day and that’s exactly how DNS operates in that environment.
Ultimately I think for a tunnel you’ll end up with your records pointing to your VPS. So you’ll have a
*.domain.tld
CNAME record and maybe a @ CNAME record and your nginx server on the other end of the tunnel would handle the routing.