This wordpress configuration was previously working @ web.MyDomain.com
LE ssl is working on web1.Mydomain.com
WordPress does not work with LE ssl and produces a 404 error.
I think this is a container communication issue but am not sure how to address it.
Thanks for your help
version: "3.3"
services:
traefik:
image: "traefik:v2.10"
container_name: "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.auth.basicauth.users=user1:$$.......,user2:$$......"
- "traefik.http.routers.traefik.rule=Host(`traefik.Mydomain.com`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=auth"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
command:
- "--api.dashboard=true"
- "--log.level=DEBUG"
#- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=cloudflare"
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=postmaster@Mydomain.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
environment:
- CLOUDFLARE_EMAIL=MyAddress@gmail.com
- CLOUDFLARE_DNS_API_TOKEN=..............
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
web1:
image: nginx:latest
container_name: "web1"
labels:
- "traefik.enable=true"
- "traefik.http.routers.web1.rule=Host(`web1.Mydomain.com`)"
- "traefik.http.routers.web1.entrypoints=websecure"
- "traefik.http.routers.web1.tls.certresolver=myresolver"
volumes:
- ./index1.html:/var/www/websites/index.html
- ./default.conf:/etc/nginx/conf.d/default.conf
nginx:
image: nginx:latest
container_name: web-serv
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=Host(`web.Mydomain.com`)"
- "traefik.http.routers.web.entrypoints=websecure"
- "traefik.http.routers.web.tls.certresolver=myresolver"
volumes:
- ./wordpress:/var/www/wordpress
- ./websites:/var/www/websites
- ./conf.d:/etc/nginx/conf.d
mysql:
image: mysql:latest
container_name: db-serv
environment:
MYSQL_DATABASE: wpdb
MYSQL_USER: wpuser
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
volumes:
- ./dbdata:/var/lib/mysql
php-fpm:
image: bitnami/php-fpm:latest
container_name: php-fpm
volumes:
- ./wordpress:/var/www/wordpress
volumes:
dbdata:
wordpress:
websites:
conf.d: