Score:0

nginx proxy reverse on docker - how add authentication for selected domain?

br flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.