I am trying to set up a HTTP/HTTPS catch-all for any undefined domain to NGINX Proxy Manager. HTTP is working great, but lots of tissues on the HTTPS side.
To keep traefik from passing its default cert through I enabled passthrough, but that instantly kills communication on the other defined routers. I wouldn't expect a rule in one router to be able to affect the rule in another, so I am missing a key concept somewhere.
version: '3.3'
services:
nginx:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
# ports:
# - '880:80'
# - '82:81'
# - '4443:443'
environment:
DISABLE_IPV6: 'true'
NGINX_HOST: nginx.moderncaveman.us
volumes:
- data:/data
- ssl:/etc/letsencrypt
deploy:
mode: replicated
replicas: 1
labels:
#Reverse Proxy SSL for Nginx Dashboard
- "traefik.enable=true"
- "traefik.http.routers.nginx.rule=Host(`nginx.moderncaveman.us`)"
- "traefik.http.routers.nginx.entrypoints=websecure,web"
- "traefik.http.routers.nginx.tls=true"
- "traefik.http.routers.nginx.tls.certresolver=letsencrypt"
- "traefik.http.routers.nginx.service=nginx"
- "traefik.http.services.nginx.loadbalancer.server.port=81"
#Catch all traffic on Port 80 for Nginx Proxy Manager
- 'traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)'
- 'traefik.http.routers.http-catchall.entrypoints=web'
- "traefik.http.routers.http-catchall.priority=1"
- "traefik.http.services.http-catchall.loadBalancer.server.port=80"
- "traefik.http.routers.http-catchall.service=http-catchall"
#Catch all traffic on Port 443 for Nginx Proxy Manager
- 'traefik.http.routers.httpscatchall.rule=hostregexp(`{host:https.+}`)'
- 'traefik.http.routers.httpscatchall.entrypoints=websecure'
- "traefik.http.routers.httpscatchall.tls=true"
# - 'traefik.tcp.routers.httpscatchall.tls.passthrough=true' <--- Kills the other two routes above
- "traefik.http.routers.httpscatchall.priority=2"
- "traefik.http.services.httpscatchall.loadBalancer.server.port=443"
- "traefik.http.services.httpscatchall.loadbalancer.server.scheme=https"
- "traefik.http.routers.httpscatchall.service=httpscatchall"
#Proxy Network
# - "traefik.docker.network=proxy"
networks:
- traefik_public
volumes:
data:
driver_opts:
type: nfs
o: addr=192.168.40.91,nfsvers=4
device: :/volume2/docker-pool/nginx2/data
ssl:
driver_opts:
type: nfs
o: addr=192.168.40.91,nfsvers=4
device: :/volume2/docker-pool/nginx2/ssl
networks:
traefik_public:
external: true
The logs will indicate the port cannot be found after uncommenting passthrough
{"container":"nginx2-nginx-4ghwh7ut4us8ufzo3u7i83dxi","level":"error","msg":"service \"nginx2-nginx\" error: port is missing","providerName":"docker","time":"2022-11-25T17:49:30-06:00"}