Self-Hosted - 2 Hostnames possible?

Hi,
I was wondering if it’s possible to have two hostname certs in BW Self-Hosted?
I have a BW Server for my family, and want to add users from my business, but I don’t necessarily want them to know they’re logging into the “home” setup… Just for consistency sake… I also don’t want to stand up another VM just to host the passwords for work…

Thanks!

Hello @StSanford,
in Principle, yes. To find out for 100%, you need to try it out. Find the bitwarden nginx configuration (should have the name default.conf).

Add an alias for the domain like this:

server_name yourdomain.com yourseconddomain.com;

If you have a proxy, both domains should direct to nginx.

If you are using different tls certificates for each domain, I suggest you read this:

Hope this helps :slight_smile:

Hello,

Maybe another solution is to have 2 diffrrents folders et launch indepently 2 dockers services.
You probably have to make change in bwdata/config.yml file (change https port for example)
At last, use proxy_pass in Nginx to redirect according to yours domains.

Hope i have been clear :upside_down_face:

Hello @StSanford,
I got a working example for you :slight_smile:. Check out the latest commit with the following domains:
bitwarden.local, botwarden.local, botwarden.home

Follow the readme.md instructions for it to work properly (5min setup) and Please If you copy it, change globalSettings__installation__id and globalSettings__installation__key.

Hope it helps :wink:

Thank you so much @Pulsar… I will give this a shot. I didn’t want to have 2 separate instances of BW, since I really want to share the same database

I have a separate nginx reverse proxy with wildcard letsencrypt certificate and it lets me do just this. with the same database/ Bitwarden instance.

Put Bitwarden on a separate port and then use Apache or Nginx as a reverse proxy as have site for each hostname with a separate certificate. Have Bitwarden looks for X-Forwarded-For as the Client IP header.

Not too familiar with Nginx (have been meaning to learn for a some time) but I am familiar with other reverse proxies.
You should also be able to set X-Real-IP to forward to IP address of the connecting client and forward that in to Bitwarden for logging.