Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Traefik - Router defined multiple times with different configurations #2096

Closed
ro-bit-admin opened this issue Apr 29, 2024 · 3 comments · Fixed by #2097
Closed

[Bug]: Traefik - Router defined multiple times with different configurations #2096

ro-bit-admin opened this issue Apr 29, 2024 · 3 comments · Fixed by #2097

Comments

@ro-bit-admin
Copy link

ro-bit-admin commented Apr 29, 2024

Description

I have a docker-compose project containing 4 services: web, api, management and presentation. When only one of them is mapped to a domain everything works great, but when mapping at least two, proxy starts to return 404s on all domains. I'm using Traefik as proxy and the docker-compose file is handled by Coolify.

Minimal Reproduction (if possible, example repository)

Current example contains only two services (web and api) for simplicity.

version: '3.8'
services:
  web:
    container_name: web-y0w8g0g
    image: 'REDACTED'
    build:
      context: ./apps/web
      dockerfile: Dockerfile.prod
    depends_on:
      - api
    restart: always
    networks:
      y0w8g0g: null
    labels:
      - traefik.enable=true
      - traefik.http.middlewares.gzip.compress=true
      - traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
      - traefik.http.routers.http-0-y0w8g0g.entryPoints=http
      - traefik.http.routers.http-0-y0w8g0g.middlewares=gzip
      - 'traefik.http.routers.http-0-y0w8g0g.rule=Host(`s0kco00.128.140.114.63.sslip.io`) && PathPrefix(`/`)'
      - traefik.http.routers.http-0-y0w8g0g.service=http-0-y0w8g0g
      - traefik.http.services.http-0-y0w8g0g.loadbalancer.server.port=3000
      - 'caddy_0.encode=zstd gzip'
      - 'caddy_0.handle_path.0_reverse_proxy={{upstreams 3000}}'
      - 'caddy_0.handle_path=/*'
      - caddy_0.header=-Server
      - 'caddy_0.try_files={path} /index.html /index.php'
      - 'caddy_0=http://s0kco00.128.140.114.63.sslip.io'
      - caddy_ingress_network=y0w8g0g
      - coolify.managed=true
      - coolify.version=4.0.0-beta.270
      - coolify.applicationId=4
      - coolify.type=application
      - coolify.name=web-y0w8g0g
      - coolify.pullRequestId=0
  api:
    container_name: api-y0w8g0g
    image: 'REDACTED'
    build:
      context: ./apps/api
      target: dev
      dockerfile: Dockerfile
    entrypoint:
      - npm
      - run
      - 'start:prod'
    restart: always
    networks:
      y0w8g0g: null
    labels:
      - traefik.enable=true
      - traefik.http.middlewares.gzip.compress=true
      - traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
      - traefik.http.routers.http-0-y0w8g0g.entryPoints=http
      - traefik.http.routers.http-0-y0w8g0g.middlewares=gzip
      - 'traefik.http.routers.http-0-y0w8g0g.rule=Host(`bgooogk.128.140.114.63.sslip.io`) && PathPrefix(`/`)'
      - traefik.http.routers.http-0-y0w8g0g.service=http-0-y0w8g0g
      - traefik.http.services.http-0-y0w8g0g.loadbalancer.server.port=3001
      - 'caddy_0.encode=zstd gzip'
      - 'caddy_0.handle_path.0_reverse_proxy={{upstreams 3001}}'
      - 'caddy_0.handle_path=/*'
      - caddy_0.header=-Server
      - 'caddy_0.try_files={path} /index.html /index.php'
      - 'caddy_0=http://bgooogk.128.140.114.63.sslip.io'
      - caddy_ingress_network=y0w8g0g
      - coolify.managed=true
      - coolify.version=4.0.0-beta.270
      - coolify.applicationId=4
      - coolify.type=application
      - coolify.name=api-y0w8g0g
      - coolify.pullRequestId=0
  volumes: {  }
networks:
  y0w8g0g:
    name: y0w8g0g
    external: true

Domains configuration:

image

Exception or Error

This is the proxy log when trying to map each service to a domain:

2024-04-29T05:32:59.948108563Z time="2024-04-29T05:32:59Z" level=error msg="Router defined multiple times with different configurations in [api-rkgk84s-162a4ec0f2eb10dc6e4b530d1b3e5b9b50b6ac74ed08497869a46f71c8c7a3c2 management-rkgk84s-648c3aaa5b75db185fe7fd5f323110bb55e3cc87922a19357dafbf29b9bf803c presentation-rkgk84s-9a2bc30e69bc9b9995bda5d28a302a629d0b7bf7165b443d85a01d0c644e185b web-rkgk84s-c015069fbdde44aefab2526aabf7031b45e74fae51447ce9c8539c82467a6532]" providerName=docker routerName=http-0-y0w8g0g

Version

v4.0.0-beta.270

@timnijland3
Copy link

I encounter the same issue since v4.0.0-beta.270

@andrasbacsai
Copy link
Member

This will be fixed in the upcoming version.

@ro-bit-admin
Copy link
Author

This will be fixed in the upcoming version.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants