Mailtrain-org / mailtrain

Self hosted newsletter app
GNU General Public License v3.0
5.53k stars 692 forks source link

Page not found when using Traefik #1023

Closed xplosionmind closed 8 months ago

xplosionmind commented 3 years ago

Hello, the following is my docker-compose.yml. I pasted in here the content of docker-compose.override.yml
Once I visit https://mailtrain.tommi.space, I get 404 page not found (see screenshot at the bottom). Where is my error (note: Traefik is up and running correctly, I have other containers which use it and they are ok)

version: '2'
services:
  mysql:
    image: mysql:5.7
    environment:
      - MYSQL_ROOT_PASSWORD=mailtrain
      - MYSQL_DATABASE=mailtrain
      - MYSQL_USER=mailtrain
      - MYSQL_PASSWORD=mailtrain
    volumes:
      - mailtrain-mysq-data:/var/lib/mysql
    restart: always
  redis:
    image: redis:3.0
    volumes:
      - mailtrain-redis-data:/data
    restart: always
  mailtrain:
    build: ./
    image: mailtrain:latest
    container_name: mailtrain
    hostname: mailtrain
    depends_on:
      - mysql
      - redis
    volumes:
      - mailtrain-node-config:/app/config
      - mailtrain-node-data:/app/public/grapejs/uploads
      - mailtrain-node-data:/app/public/mosaico/uploads
      - mailtrain-node-reports:/app/protected/reports
    ports:
      - "3000:3000"
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.mailtrain-trusted.backend=mailtrain-trusted"
      - "traefik.mailtrain-trusted.frontend.rule=Host:mailtrain.tommi.space"
      - "traefik.mailtrain-trusted.frontend.headers.SSLRedirect=true"
      - "traefik.mailtrain-trusted.port=3000"
      - "traefik.mailtrain-trusted.protocol=http"
volumes:
  mailtrain-mysq-data: {}
  mailtrain-redis-data: {}
  mailtrain-node-data: {}
  mailtrain-node-config: {}
  mailtrain-node-reports: {}

The error message: Screenshot 2021-03-14 at 5 47 19 PM

Thank y'all very much in advance!

xplosionmind commented 3 years ago

Note: I get the same error message also when visiting http://mailtrain.tommi.space. Nevertheless, when I visit http://my.ip.address:3000 I see everything! It probably is a Traefik error.

Zir0h commented 3 years ago

Your service / backend name don't align. Maybe try

    labels:
      - "traefik.enable=true"
      - "traefik.mailtrain.backend=mailtrain"
      - "traefik.mailtrain.frontend.rule=Host:mailtrain.tommi.space"
      - "traefik.mailtrain.frontend.headers.SSLRedirect=true"
      - "traefik.mailtrain.port=3000"
      - "traefik.mailtrain.protocol=http"

// edit: actually I'm a bit confused. Is this on traefik 1.7 or 2.x?

xplosionmind commented 3 years ago

I changed this as you pointed out. unfortunately, still the same result. I am using Traefik 2.4

Zir0h commented 3 years ago

And like this?

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.mailtrain.rule=Host(`mailtrain.tommi.space`)"
      - "traefik.http.routers.mailtrain.tls=true"
      - "traefik.http.services.mailtrain.loadbalancer.server.port=3000"

Your config looks like a mix of 1.X and 2.x to me.

https://doc.traefik.io/traefik/routing/providers/docker/#routers for full docs.

talheim-it commented 8 months ago

We are going to start with the development and testing of mailtrain v3 in the next weeks.

You are welcome to help us with the testing as soon as the first release candidate is available.