Closed twigley closed 7 months ago
Add a trailing slash to all prefixes and the url you're accessing: http://mylocal.domain/gotify/
Add a trailing slash to all prefixes and the url you're accessing: http://mylocal.domain/gotify/
You're a star @jmattheis , it looks like that fixes it within the context of how I'm using it. I'm using homepage so I've just added a trailing slash to the href config for the container and it works now via the sub path. e.g
gotify:
container_name: gotify
image: gotify/server
environment:
- TZ=${TIMEZONE}
volumes:
- ${CONFIG_PATH}/gotify:/app/data
labels:
- traefik.enable=true
- traefik.http.routers.gotify.rule=PathPrefix(`/gotify`)
- traefik.http.services.gotify.loadbalancer.server.port=80
- traefik.http.routers.gotify.middlewares=gotify
- traefik.http.middlewares.gotify.stripprefix.prefixes=/gotify
- homepage.group=Management
- homepage.name=Gotify
- homepage.icon=gotify.png
- homepage.href=/gotify/
- homepage.description=Notifications
Much appreciated!
Have you read the documentation?
You are setting up gotify in
Describe your problem
I'm trying to run gotify from behind Traefik on a subpath rather than a subdomain running with a docker-compose stack as:
Gotify doesn't appear to respect the header X-Forwarded-Prefix mentioned within https://doc.traefik.io/traefik/middlewares/http/stripprefix/#configuration-options so while the index returns a 200 all static objects return a 404 because they revert to the root path rather than the prefixed path e.g
http://mylocal.domain/gotify - returns a 200 HTTP code
http://mylocal.domain/static/js/main.f445756e.chunk.js - Returns a 404 as it's trying to load the asset from the root path, ignoring X-Forwarded-Prefix.
I'm wondering if there's any way around this without code changes to Gotify. I've looked through a few historical issues but not found anything specific to the use of sub paths that might fix it. I can't find any reference to the header in code so I'm presuming it's not utilised, but I'm not a Go dev by any stretch.
Any errors, logs, or other information that might help us identify your problem
Ex:
docker-compose.yml
,nginx.conf
, android logcat, browser requests, etc.Example logs from Traefik