does anyone have a good solution for using docker-compose to create multiple virtual hosts using nginx AND ssl.
does anyone have a good solution for using docker-compose to create multiple virtual hosts using nginx AND ssl.
looking to host multiple virtual hosts that may use a nginx docker image or even a wordpress image, all using SSL (letsencrypt-nginx-proxy-companion)
not sure if anyone has run into this problem and created a simple solution..
thanks -p
1 Reply
I actually recently discussed this in another post - you should checkout NGINX-Proxy-Manager (NPM) since it lets you manage both your reverse proxy and the SSL cert within its GUI. You will need to define the NPM Docker network nginxproxymanager_default
within docker-compose.yml files that will make use of that network, more-or-less looking like this:
version: 'X'
services:
$APP_NAME:
container_name: $NAME_YOUR_CONTAINER
### CONTAINER SPECS GO HERE
ports:
- '$PORT:$PORT'
networks:
- nginxproxymanager_default
## ANY OTHER CONTAINER SPECS ALSO GO HERE
...
networks:
nginxproxymanager_default:
external: true
Once the Docker container is running, you can then generate both the reverse proxy and the SSL cert needed to connect via https://example.domain.com/
.
For more information about the app's specific uses and nuances, I'd recommend checking out the NGINX Proxy Manager main page: