Dynamic config help

Hi,

I have been using traefik for quite some time with no issues.

I have a traefik running in a docker stack along with a number of other services

I am having trouble with getting uptime-kuma to work with traefik due to its double path prefix ( apologies if this is not the correct terminology)

my dynamic config file looks like the following:

http:
  routers:
    status-kuma-rtr:
      rule: Host(`status.domain.co.uk)
      entryPoints:
        - websecure
      middlewares:
        - status-kuma-add-prefix
      service: status-kuma-svc
      tls:
        certResolver: production
  middlewares:
    status-kuma-add-prefix:
      addPrefix:
        prefix: "/status/homelab/"
  services:
    status-kuma-svc:
      loadBalancer:
        servers:
          - url: "http://192.168.0.99:3001"

I know its got to do with the 2 paths (/status/homelab)

Please also be aware that uptime-kuma is running on a different docker host

I have got the add prefix working with my 2 pi-holes - again running on seperate hosts but these only have the 1 path - the config for this is below:

http:
  routers:
    pihole-rpi-rtr:
      rule: Host(`pihole.domain.co.uk`)
      entryPoints:
        - websecure
      middlewares:
        - lanipwhitelist@file
        - pihole-rpi-add-admin
      service: pihole-rpi-svc
      tls:
        certResolver: production
  middlewares:
    pihole-rpi-add-admin:
      addPrefix:
        prefix: "/admin"
  services:
    pihole-rpi-svc:
      loadBalancer:
        servers:
          - url: "http://192.168.0.2"

Any assistance with what I am missing or doing incorrectly would be appreciated

thanks

Alex

What is your problem?

Web-apps usually run better with sub-domains than with path prefix, because their response can contain redirects and links that then don’t work.

Thanks for your reply.

Yeah I was creating a subdomain but the way that uptime kumas status page work is you got to:

http:// IP:3001/status/insertwhateverhere

I was trying to get it to go through traefik so it's associated with my domain and use path prefix so:

https://subdomain.domain.co.uk take me to the page.

I have since figured out that there was a setting within uptime kumas dashboard settings that allows me to go direct to the status page

Therefore I have no need to use the add prefix option in my dynamic config and the below config now works:

http:
routers:
kuma:
rule: "Host(status.domain.co.uk)"
service: kuma
entrypoints:
- websecure
tls:
certresolver: production
services:
kuma:
loadBalancer:
servers:
- url: "http://192.168.0.99:3001"

Thanks again though.

Alex

I understand your idea about the path

But the page will probably load further resources (scripts, images) that don’t work anymore.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.