https-portal icon indicating copy to clipboard operation
https-portal copied to clipboard

Traefik : Too many redirect

Open jurnet opened this issue 4 years ago • 1 comments

Hello from France I'd like to use your compose but I've got too many redirect and don't know why. I have a docker with traefik which listen on 80 and 443 and your docker compose My domain jpj.ovh have a wildcard with traefik docker compose I just want to use subdomain 'lf.jpj.ovh' to have a wordpress

With this docker compose I've got : Too many redirect

version: '2.1'

services:
  https-portal:
    image: steveltn/https-portal:1
    container_name: https
    volumes:
      - ./logs/nginx:/var/log/nginx
    ports:
      - '801:80'
      - '802:443'
    environment:
      CLIENT_MAX_BODY_SIZE: '100M'
      GZIP: 'on'
      DOMAINS: 'lf.jpj.ovh -> http://wordpress:80'
      STAGE: 'local'
    restart: unless-stopped
    networks:
      - web
      - lf
    labels:
      traefik.enable: "true"
      traefik.http.routers.lf.rule: "Host(`lf.jpj.ovh`)"
      traefik.http.routers.lf.entrypoints: "websecure"

  wordpress:
    depends_on:
      db:
        condition: service_healthy
    image: wordpress:5.4.2-apache
    container_name: wp
    volumes:
      - ./wordpress:/var/www/html
      - ./wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    environment:
      WORDPRESS_DB_USER: 'admin'
      WORDPRESS_DB_NAME: 'lf'
      WORDPRESS_DB_PASSWORD: 'admin'
      WORDPRESS_DB_HOST: 'db'
      MYSQL_PORT_3306_TCP: '3306'
    restart: unless-stopped
    networks:
      - lf
   
  db:
    image: mysql:5.7
    container_name: db
    volumes:
      - ./wp-db-data:/var/lib/mysql
    healthcheck:
      test: "/usr/bin/mysql --user=root --password='admin' --execute \"SHOW DATABASES;\""
      interval: 2s
      timeout: 20s
      retries: 10
    environment:
      MYSQL_ROOT_PASSWORD: 'admin'
      MYSQL_DATABASE: 'lf'
      MYSQL_USER: 'admin'
      MYSQL_PASSWORD: 'admin'
    restart: unless-stopped
    networks:
      - lf

networks:
  web:
    external:
      name: web
  lf:  

I don't know If I have to use network "web" created by traefik I think but I will wait your answer

Thanks for your help

jurnet avatar Dec 11 '21 17:12 jurnet

You don't need to use web for the network name. Can you curl it to see what the redirection paths are? Visit https://lf.jpj.ovh, see where it redirects to, and then manually curl the next step, until we find the loop. That will usually help debugging a lot.

SteveLTN avatar Dec 14 '21 06:12 SteveLTN