After a zillion failed attempts i finally got container "whoami" working perfectly with Lets encrypt using https....
i can reach container "whoami" both internally and externally (using 4g on my cell phone)
i decided to take the same exact config and try my luck with adding an "airsonic" container
but when trying to access airsonic
airsonic.home.mycustomdomain.com
i get a 404 error
i can only log into the container via local ip address:4040 if i manually expose the port with
I know the container works because i can log into the container via localipaddress:4040 if i manually expose the port with
labels:
- "traefik.http.services.airsonic.loadbalancer.server.port=4040"
ports:
- "4040:4040"
so i know the container is running
Heres my dashboard ( i can only do 2 images since im new user)
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
55bca9f22814 airsonic/airsonic "tini -- run.sh" 7 hours ago Up 7 hours (healthy) 0.0.0.0:4040->4040/tcp airsonic
c501771758c9 traefik:v2.1 "/entrypoint.sh --lo…" 8 hours ago Up 8 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp traefik
bfc96e124993 containous/whoami "/whoami" 8 hours ago Up 8 hours 80/tcp whoami
680cea55b9c1 emby/embyserver:latest "/init" 3 weeks ago Up 6 days 1900/udp, 0.0.0.0:8096->8096/tcp, 7359/udp, 0.0.0.0:8920->8920/tcp emby
docker-compose.yml
version: "3.3"
services:
traefik:
image: "traefik:v2.1"
container_name: "traefik"
command:
# Logging
- "--log.level=DEBUG"
# Traefik will listen on port 8080 by default for API request.
- "--api.insecure=true"
# Enabling docker provider
- "--providers.docker=true"
# Do not expose containers unless explicitly told so
- "--providers.docker.exposedbydefault=false"
# Traefik will listen to incoming request on the port 80 (HTTP) and 443 (HTTPS)
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
# Enable a dns challenge named "myresolver"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
# Tell which provider to use
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=cloudflare"
# Choose acme-staging to test things... remove this when ready for the real thing
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
# The email to provide to let's encrypt
- "--certificatesresolvers.myresolver.acme.email=mycustomemail@gmail.com"
# Tell to store the certificate on a path under our volume
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`server.home.mycustomdomain.com`)"
- "traefik.http.routers.traefik.entrypoints=web"
ports:
- "80:80"
- "443:443"
- "8080:8080"
environment:
- "CF_API_EMAIL=mycustomemail@gmail.com"
- "CF_API_KEY=mycustomcfapikey"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
#- /media/username/nfsset/containers/traefik/traefik.toml:/etc/traefik/traefik.toml
- "/media/username/nfsset/containers/traefik/letsencrypt:/letsencrypt"
#- "/media/username/nfsset/containers/traefik/acme.json:/acme.json"
whoami:
image: "containous/whoami"
container_name: "whoami"
labels:
# Explicitly tell Traefik to expose this container
- "traefik.enable=true"
# The domain the service will respond to
- "traefik.http.routers.whoami.rule=Host(`whoami.home.mycustomdomain.com`)"
# Allow request only from the predefined entry point named "web" to route called "whoami"
- "traefik.http.routers.whoami.entrypoints=websecure"
# Uses the Host rule to define which certificate to issue to route called "whoami"
- "traefik.http.routers.whoami.tls.certresolver=myresolver"
#ports:
#- "80:80"
airsonic:
image: "airsonic/airsonic"
container_name: "airsonic"
labels:
# Explicitly tell Traefik to expose this container
- "traefik.enable=true"
# The domain the service will respond to
- "traefik.http.routers.airsonic.rule=Host(`airsonic.home.mycustomdomain.com`)"
# Allow request only from the predefined entry point named "web" to route called "XXX"
- "traefik.http.routers.airsonic.entrypoints=websecure"
# Uses the Host rule to define which certificate to issue to route called "XXX"
- "traefik.http.routers.airsonic.tls.certresolver=myresolver"
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- "/media/username/nfsset/containers/airsonic/data:/airsonic/data"
- "/media/username/nfsset/containers/airsonic/music:/airsonic/music"
- "/media/username/nfsset/containers/airsonic/playlists:/airsonic/playlists"
- "/media/username/nfsset/containers/airsonic/podcasts:/airsonic/podcasts"
- "/media/username/smbshare/Music/:/media/username/smbshare/Music"
#ports:
#- "4040:4040"
restart: unless-stopped
Why CAN i access my whoami container inside and outside my network but i CANT access my airsonic container...
Thanks in advance