Hello, I'm trying to setup wordpress site behind traefik proxy but I'm having a problem with connecting other domain name to it. It worked just fine with my main domain that traefik and portainer runs on. Let's call it main.tld. This domain and its subdomains work just fine. Eg traefik.main.tld, cdn.main.tld. I connected my wordpress to it (wp.main.tld) and it worked just fine, but when I tried to switch to wp.other.tld it returns 404. (wordpress is not to blame, I tried completely new instance and the same thing happened even before I set up the WP domain names.)
com.docker.compose.project=arm-wp
com.docker.compose.project.config_files=/data/compose/9/docker-compose.yml
com.docker.compose.project.working_dir=/data/compose/9
com.docker.compose.service=v-wordpress
com.docker.compose.version=2.20.2
traefik.enable=true
traefik.http.routers.wordpress.entrypoints=websecure
traefik.http.routers.wordpress.priority=50
traefik.http.routers.wordpress.rule=Host(`wp.other.tld`) || Host(`wp.main.tld`)
traefik.http.routers.wordpress.tls=true
traefik.http.routers.wordpress.tls.certresolver=leresolver
traefik.port=80
Here is my wordpress traefik configuration
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --log.level=DEBUG
- --providers.docker.network=websites
# - --providers.docker.exposedByDefault=false
# - --entrypoints.web.address=:80
# - --entrypoints.web.http.redirections.entrypoint.to=websecure
# - --entryPoints.web.http.redirections.entrypoint.scheme=https
# - --entrypoints.websecure.address=:443
# - --entrypoints.websecure.asDefault=true
- --certificatesresolvers.leresolver.acme.httpchallenge=true
- --certificatesresolvers.leresolver.acme.email=mymain@email.com
- --certificatesresolvers.leresolver.acme.storage=./acme.json
- --certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=web
- --api.dashboard=true
- --accesslog=true
- --accesslog.addinternals
labels:
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# traefik dashboard config
- "traefik.http.routers.traefik_https.rule=Host(`traefik.main.tld`)"
- "traefik.http.routers.traefik_https.entrypoints=websecure"
- "traefik.http.routers.traefik_https.tls=true"
- "traefik.http.routers.traefik_https.service=api@internal"
- "traefik.http.routers.traefik_https.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.usersfile=/userfiles/traefik.main.tld"
- "traefik.http.routers.http_traefik.rule=Host(`traefik.main.tld`)"
- "traefik.http.routers.http_traefik.entrypoints=web"
- "traefik.http.routers.http_traefik.middlewares=https_redirect"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
And here is my traefik container relevan docker-compose part.
I can't figure out why the *.main.tld works just fine while the *.other.tld doesn't
Both have cloudflare DNS and the DNS is configured (I believe) correctly both other and main have wildcard to the server and specific subdomains to the same address (they are there just so I can remove the wildcard record anytime)
Thank you so much for any help.