mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 00:22:42 -05:00
[GH-ISSUE #2294] Path-Based-Routing is broken #4071
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kylepyke on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/2294
Originally assigned to: @oschwartz10612 on GitHub.
Describe the Bug
Multiple targets on a single domain act as load balancers regardless of match-path rules or priority.
Environment
Ubuntu 22.04
1.14.1
Latest
Latest
1.8.1
N/A
To Reproduce
Set a path based rule, and try to trigger it. For example set the following rules on any resource:
Prefix: "/" -> 192.168.1.7:3000
Prefix: "/api" -> 192.168.1.7:3001
The backend service that is returned will be random, completely ignoring PBR rules.
I have also tried only setting a single prefix rule for "/api", and changing priorities to be equal, above, below, equal non-100, and non-100 above/below.
Regardless, the service returned is random.
Expected Behavior
domain.com would route to the service on 192.168.1.7:3000 and domain.com/api (or /api/share etc.) would route to the service on 192.168.1.7:3001.
@nicholasliverett commented on GitHub (Jan 27, 2026):
This is still an issue with 1.15.1. Changing priority does nothing load balancing appears to always be random.
@l3ztum commented on GitHub (Jan 30, 2026):
Have encountered the same problem with my setup. Was trying Prefix '/share' and Regex '^/share.*' which both do not seem to work. If i deactivate the root target for sub-domain <example.domain.org>, i correctly get a 404 with the sub-domain and i'll be forwarded to the configured second target with <example.domain.org>/share.
@kylepyke commented on GitHub (Feb 1, 2026):
@oschwartz10612 can you reproduce? Do you have any updates on this?
@shreyaspapi commented on GitHub (Feb 23, 2026):
I've been looking into this. The path-based routing key generation has a collision bug I've fixed in #2524, but it wouldn't affect the / vs /api case.
Could you check if the path and pathMatchType values are actually saved in the database for your targets? If they're null, both targets would end up in the same loadbalancer and round-robin. You can check with: SELECT targetId, path, pathMatchType FROM targets WHERE resourceId = ;
@shreyaspapi commented on GitHub (Feb 23, 2026):
I found a collision bug in the
sanitize()function used to group targets into Traefik routers — paths like/a/band/a-bproduce the same key and end up in one loadbalancer instead of getting separate routers. I opened #2524 to fix that.However, tracing through the code for the specific
/vs/apiscenario described here, the keys are already different (1-prefixvs1-api-prefix), so the sanitize collision alone wouldn't explain this.You could check with something like:
@thutex commented on GitHub (Mar 25, 2026):
i don't seem to have this issue with my matrix instance, where i route the well-known to a webcontainer, the 3 matrix url's to a matrix container, and the default path to the sable container.
so 1 domain, 3 different docker containers (on the same resource) and 4 paths
@Kadz93 commented on GitHub (Apr 16, 2026):
I would like to push this issue, using path based routing is unusable e.g. for immich
@LaurenceJJones commented on GitHub (Apr 17, 2026):
Okay any steps we can take to reproduce issue for immich, cause just stating is unusable doesnt aid us in rectifying the issue.