To use the nginx proxy to serve mulitple instances of dockerised nginx in the same servers you need to do the following:
In proxy/hosts copy the file default.conf.example
and rename is so it fits your endpoint. Please make sure to use the extension .conf
Edit your new file and make sure to replace the following:
URL
with the url of your endpoint
PORT
with the name of the nginx instance of your docker exposing port 80
cd .docker
docker-compose build
docker-compose up -d
sudo ufw allow 80
sudo ufw allow 443
sudo chmod +X letsencrypt.sh
./letsencrypt.sh -d YOURDOMAINNAMEHERE -e YOUREMAILHERE -s
./letsencrypt.sh -d YOURDOMAINNAMEHERE -e YOUREMAILHERE
In your configuration file in proxy/hosts
you need to remove all the comments
cd .docker
docker-compose down
docker-compose up -d
You are good to go, the proxy will manage the certificate, and your nginx should only expose port 80