I want to add a selected domain like test.domain.com, authentication on password.
Below my configuration docker-compose.yml for nginx
- letsencrypt and docker-compose.yml for single domain.
- docker-compose for nginx + le
services:
nginx:
container_name: nginx
image: nginxproxy/nginx-proxy
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /var/docker/nginx/html:/usr/share/nginx/html
- /var/docker/nginx/certs:/etc/nginx/certs
- /var/docker/nginx/vhost:/etc/nginx/vhost.d
logging:
options:
max-size: "10m"
max-file: "3"
letsencrypt-companion:
container_name: nginx-le
image: jrcs/letsencrypt-nginx-proxy-companion
restart: unless-stopped
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/docker/nginx/acme:/etc/acme.sh
environment:
DEFAULT_EMAIL: [email protected]
- docker-compose for single domain
services:
web:
container_name: test.domain.com
image: kornkitti/express-hello-world
expose:
- "8080"
environment:
VIRTUAL_HOST: test.domain.com
LETSENCRYPT_HOST: test.domain.com
networks:
- proxy
networks:
proxy:
external:
name: nginx_default
I want domain test.domain.com to add authentication on password, for other domains no.