version: "3.8" services: apache-test: build: .. image: my_apache:7.4.28 container_name: apache-test networks: - proxy expose: - "80" restart: unless-stopped volumes: - /usr/lib/locale/:/usr/lib/locale/ - /etc/localtime:/etc/localtime:ro - ${DATA_PATH}:/var/www/ labels: - "traefik.enable=true" - "traefik.http.middlewares.apache-redirect-websecure.redirectscheme.scheme=https" - "traefik.http.routers.apache-test-http.middlewares=apache-redirect-websecure" - "traefik.http.routers.apache-test-http.rule=Host(`${CN}`, `${SAN1}`)" - "traefik.http.routers.apache-test-http.entrypoints=web" - "traefik.http.routers.apache-test-https.rule=Host(`${CN}`, `${SAN1}`)" - "traefik.http.routers.apache-test-https.entrypoints=websecure" - "traefik.http.routers.apache-test-https.middlewares=apache-test-redirectregex" - "traefik.http.routers.apache-test-https.tls=true" - "traefik.http.routers.apache-test-https.tls.certresolver=myhttpchallenge" - "traefik.http.middlewares.apache-test-redirectregex.redirectregex.regex=^https://${SAN1}/(.*)" - "traefik.http.middlewares.apache-test-redirectregex.redirectregex.replacement=https://${CN}/$${1}" networks: proxy: external: true