Docker install behind nginx reverse proxy

I found this open source project looking for alternatives to commercial implementations (currently LastPass). And that the project owners have a Docker deployment model for self-hosting.

On my Docker install, I currently use the jwilder\nginx-proxy reverse proxy with the companion letsencrypt-nginx-proxy container for automated Lets Encrypt certificate management. All I need to do is supply an extra Environment Variable (“VIRTUAL_HOST”) to the web server container of any solution.

This page has an architecture topology diagram to explain:
https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion

Essentially, how can I use the default installer to deploy this behind my reverse proxy and Lets Encrypt generator?
Do I need to customise anything?
I expect the script handles calls to Docker Hub to pull the appropriate images, and then deploy containers from these images - this restricts my ability to supply the VIRTUAL_HOST Environment Variable.

Did you find any solution to that? I am looking to do the same as well

apologies @hanneshier, I did resolve this but had another thread on this forum that had useful info.

Essentially, you keep the default / standard install methods & guides. But in the bwdata\docker subfolder, I added a new file named docker-compose.override.yml with:

version: ‘3’

services:
nginx:
environment:
- VIRTUAL_HOST=vault.domain.com
- VIRTUAL_PORT=8080
- LETSENCRYPT_HOST=vault.domain.com
- [email protected]

networks:
default:
external:
name: nginx-proxy-net

This should override the config of the front-end Nginx container, to incorporate the required Environment variables for the Nginx-proxy. Most notable though is that the final networks section is the “default” for ALL containers in this stack. I could only get it working with this configuration which isn’t my preferred topology when using this concept.

1 Like

Hi @monkeyguest, thanks a lot already!
Can you post a link to that other thread you mentioned? Just adding the docker-compose.override.yml didnt word for me yet.

Thats the error I got in the end, in case you have any idea what to do with it :slight_smile:

Creating bitwarden-nginx ... error

ERROR: for bitwarden-nginx  Cannot start service nginx: driver failed programming external connectivity on endpoint bitwarden-nginx (7988b60bd59ad7dc7176471c99f77713a783db646b723660b738c0cb0f4f523b): Bind for 0.0.0.0:443 failed: port is aCreating bitwarden-events ... done

ERROR: for nginx  Cannot start service nginx: driver failed programming external connectivity on endpoint bitwarden-nginx (7988b60bd59ad7dc7176471c99f77713a783db646b723660b738c0cb0f4f523b): Bind for 0.0.0.0:443 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

And also in the beginning, I got this warning

Removing network docker_public
WARNING: Network docker_public not found.

And one other question: did you generate a SSL cerificate or said to use one in the initial setup? Or did you skip this step since the letsencrypt-nginx-proxy is doing that?

I got it now :smiley:
So for any future reader: I forgot to change the port in the config.yml. So for http I used a random port that was not occupied, and entered no port at all for https (since my reverse proxy is handling that).

You dont have to generate a SSL, since the nginx is handling that again