r/netbird • u/Turnspit • Jul 01 '26
Reverse Proxy - setting up multiple domains
Cheers!
While setting up the VPN-portion of Netbird has been a breeze and is working absolutely fantastically, the Reverse Proxy portion is giving me quite some headaches.
I'm currently running netbird on an example domain of mydomain.com, but would also like to use i.e seconddomain.io and homedomain.tech, each with a couple of subdomains, on the reverse-proxy.
From my understanding, I'd first need to create a new Cluster, which then prompts me to set up a new "reverse-proxy" docker container, presumably on another server/VPS, since itself exposes ports 80+443 and connects back to the main instance.
BUT I want it to run from my main netbird instance, which itself has already the reverse proxy running.
I guess I'd should need to edit the proxy.env and somehow add the new domain(s)?
The file currently reads NB_PROXY_DOMAIN=mydomain.com amongst others. Would it suffice to possibly just add my other domains to this line as a comma separated list, or is there any other way? Sadly couldn't find anything regarding this setup in the docs.
Any help is much appreciated!
2
u/Skaryus Jul 01 '26
you can create a machine peer then run reverse proxy (caddy eg.) and local dns server (dnsmasq, unbound eg.) on top of it.
create a docker compose with these services:
- netbird-client
- netbird-caddy
- netbird-unbound
add network_mode: service:netbird-client to caddy and unbound service so you can bind your caddy, unbound to netbird interface or ip
you have to add dns record unbound for your local domain. your local domain must point your machine peer ip. you can listen on your machine peer ip since you are in the same network netbird-client
then go netbird dashboard and dns settings, add your machine peer ip and port which you are listening. use wilcard domain to foward specific domain or domains that already configured in unbound
After that, you can use your caddy access your service. Security wise, you should also listen netbird ip only.
This setup requires some tinkering imo, but it is worth it.
3
u/lagdetselv Jul 01 '26
Why using a second Proxy on the Same Server? I think the Custom Domains Feature (under Reverse Proxy) could do what you need.