在使用路径访问traefik的dashboard时,不需要进行设置,因为dashboard的内部服务就是基于二级路径。但是当转发的是基于根路径的内部服务时,会出现错误,因为转发时会同时将路径一起转发,这个时候有一个方案就是使用一个中间件,将二级路径转换为根路径。
例如转发内部的php服务
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Dynamic configuration http:   routers:     http-php:       entryPoints:         - "web"       rule: "PathPrefix(`/php`)"       service: "php@docker"       middlewares:         - replacepath   middlewares:     replacepath:       replacePath:         path: "/" | 
There are no comments yet