this post was submitted on 13 Sep 2024
4 points (83.3% liked)

homelab

457 readers
1 users here now

homelab

founded 1 year ago
MODERATORS
 

Hello friends, I've been pulling my hair out trying to figure out how to get my service to properly play well with traefik.

My service is reachable at /dnd-notes/page, but the service needs to fetch additional resources and fails to do so.

IE: user navigates to /dnd-notes/foobar

foobar loads. foobar fetches /.client/main.css foobar fails to find this resource.

Here is my static configuration:

## traefik-static.yml
providers:
  docker:     
    exposedByDefault: false
    
api:
  insecure: true
  dashboard: true

entryPoints: 
  web:
    address: :80
  websecure:  
    address: :443
    
log:
  level: DEBUG

Here is my compose:

services:
  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./traefik/traefik.yaml:/etc/traefik/traefik.yaml"

  silverbullet:
    image: zefhemel/silverbullet
    container_name: "dnd-notes"
    volumes:
      - './dnd-notes/space:/space'
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dndnotes.rule=PathPrefix(`/dnd-notes/`)"
      - "traefik.http.routers.dndnotes.service=dndnotes"
      - "traefik.http.routers.dndnotes.entrypoints=web"
      - "traefik.http.routers.dndnotes.middlewares=dndnotes_stripprefix"
      - "traefik.http.services.dndnotes.loadbalancer.server.port=3000"
      - "traefik.http.middlewares.dndnotes_stripprefix.stripprefix.prefixes=/dnd-notes"
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 1 month ago* (last edited 1 month ago) (1 children)

Sorry, can't help you. But as no other answered yet I was in a similar situation, gave up and used Caddy as a simpler reverse-proxy. But I don't know if it fits your needs.

[โ€“] [email protected] 1 points 1 month ago

Thanks, i'll look at Caddy. This seems super simple if I have a domain name and use prefixes on that, but with paths it gets complex.