# Diagnosing Bad Gateway Error when attempting to access Seafile Docker Container

**URL:** <https://community.traefik.io/t/diagnosing-bad-gateway-error-when-attempting-to-access-seafile-docker-container/12993>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [January 10, 2022, 7:46pm UTC](https://community.traefik.io/t/diagnosing-bad-gateway-error-when-attempting-to-access-seafile-docker-container/12993 "2022-01-10T19:46:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abj298](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@abj298](https://community.traefik.io/u/abj298)\
**Post date:** [January 10, 2022, 7:46pm UTC](https://community.traefik.io/t/diagnosing-bad-gateway-error-when-attempting-to-access-seafile-docker-container/12993/1 "2022-01-10T19:46:48Z")

</div>

Hi, I've scoured pretty much every traefik forum/stackoverflow/reddit post relating to bad gateway issues but still stumped. I'm trying to get seafile running in a docker container, I've got the traefik dashboard up and running but when I visit [seafile.example.com](http://seafile.example.com) I get a blank page with "Bad Gateway" in the corner.

From what I've read I think it is a network/port related issue with Traefik not being able to properly reach the service - but not quite sure how to diagnose this? This is probably down to me not understanding routers/services properly but any pointers would be much appreciated.

My docker-compose.yml is as follows:

```auto
version: '3.0'

networks:
  web:
    external: true
  internal:
    external: false
  seafile-net:

services:
  db:
    image: mariadb:10.5
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /opt/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net
      - internal
    labels:
      - traefik.enable=false

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
      - internal
    labels:
      - traefix.enable=false

  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    volumes:
      - /opt/seafile-data:/shared  
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=password  
      - TIME_ZONE=Etc/UTC
      - SEAFILE_ADMIN_EMAIL=email@example.com
      - SEAFILE_ADMIN_PASSWORD=password
      - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=seafile.example.com 
      - SEAFILE_SERVER_URL=https://seafile.example.com

    expose:
      - 8000
      - 8082
      - 8080
    labels:
      - traefik.enable=true
# HTTP Router Seafile
      - traefik.http.routers.seafile.rule=Host(`seafile.example.com`)
      - traefik.http.routers.seafile.entrypoints=websecure
      - traefik.http.routers.seafile.tls=true
      - traefik.http.routers.seafile-http.middlewares=sec-headers
      - traefik.http.routers.seafile.service=seafile
      - traefik.http.services.seafile.loadbalancer.server.port=8000
# HTTP Router Seafdav
      - traefik.http.routers.seafile-dav.rule=Host(`seafile.example.com`) && PathPrefix(`/seafdav`)
      - traefik.http.routers.seafile-dav.entrypoints=websecure
      - traefik.http.routers.seafile-dav.tls=true
      - traefik.http.routers.seafile-dav.service=seafile-dav
      - traefik.http.services.seafile-dav.loadbalancer.server.port=8080
# HTTP Router Seafhttp
      - traefik.http.routers.seafile-http.rule=Host(`seafile.example.com`) && PathPrefix(`/seafhttp`)
      - traefik.http.routers.seafile-http.entrypoints=websecure
      - traefik.http.routers.seafile-http.tls=true
      - traefik.http.routers.seafile-http.middlewares=seafile-strip
      - traefik.http.routers.seafile-http.service=seafile-http
      - traefik.http.services.seafile-http.loadbalancer.server.port=8082
# Middlewares
      - traefik.http.middlewares.seafile-strip.stripprefix.prefixes=/seafhttp
      - traefik.http.middlewares.sec-headers.headers.framedeny=true
      - traefik.http.middlewares.sec-headers.headers.sslredirect=true
      - traefik.http.middlewares.sec-headers.headers.browserXssFilter=true
      - traefik.http.middlewares.sec-headers.headers.contentTypeNosniff=true
      - traefik.http.middlewares.sec-headers.headers.forceSTSHeader=true
      - traefik.http.middlewares.sec-headers.headers.stsIncludeSubdomains=true
      - traefik.http.middlewares.sec-headers.headers.stsPreload=true
      - traefik.http.middlewares.sec-headers.headers.referrerPolicy=same-origin

      - traefik.docker.network=web
      - traefik.http.routers.seafile.tls.certresolver=lets-encrypt
      - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
      - traefik.http.routers.https-redirect.entrypoints=web
      - traefik.http.routers.https-redirect.middlewares=https-redirect
      - traefik.http.routers.https-redirect.rule=Host(`seafile.example.com`)

    depends_on:
      - db
      - memcached
    networks:
      - seafile-net
      - web
      - internal

```

My traefik.toml files:

```auto
[entryPoints]
  [entryPoints.web]
    address = ":80"
    [entryPoints.web.http.redirections.entryPoint]
      to = "websecure"
      scheme = "https"
  [entryPoints.websecure]
    address = ":443"

[api]
  dashboard = true
[certificatesResolvers.lets-encrypt.acme]
  email = "email@example.com"
  storage = "acme.json"
  [certificatesResolvers.lets-encrypt.acme.tlsChallenge]

```

traefik\_secure.toml:

```auto
[http.middlewares.simpleAuth.basicAuth]
  users = [
    # user info
  ]

[http.routers.api]
  rule = "Host(`traefik.example.com`)"
  entrypoints = ["websecure"]
  middlewares = ["simpleAuth"]
  service = "api@internal"
  [http.routers.api.tls]
    certResolver = "lets-encrypt"

```

I've checked traefik dashboard and all the container logs and can't see any issues being reported. The labels were pulled from here [Help with traefik v2 labels? - Docker - Seafile Community Forum](https://forum.seafile.com/t/help-with-traefik-v2-labels/13868/)
