V1至V2路径前缀

问题描述

你好,我将V1迁移到V2

我在v1中使用它:

labels:
- "traefik.web.port=8082"
- "traefik.web.frontend.rule=Host:${pom_subdomain}._URL_SITE_"
- "traefik.wss.port=8081"
- "treafik.wss.frontend.entrypoints=ws"
- "traefik.wss.frontend.rule=Host:${pom_subdomain}._URL_SITE_;PathPrefixStrip:/rest"
- "traefik.docker.network=traefik-net"

所以我正在寻找文档:https://docs.traefik.io/migration/v1-to-v2/

所以瞧瞧!

labels:
- "traefik.enable=true"
- "traefik.http.routers.aideopp.entrypoints=web"
- "traefik.http.routers.aideopp.rule=Host(\${pom_subdomain}.URL_SITE\)"
- "traefik.http.services.aideopp.loadbalancer.server.port=8082"
- "traefik.http.routers.aideopp-ws.entrypoints=web"
- "traefik.http.routers.aideopp-ws.rule=Host(`${pom_subdomain}.URL_SITE`) && PathPrefix(`/rest`)"
- "traefik.http.services.aideoperateur-ws.loadbalancer.server.port=8081"
- "traefik.docker.network=traefik-net"

但是它不起作用:/我有一些好的眼睛

解决方法

您是否尝试过为/ rest添加一个StripPrefix?

尝试:

  • “ traefik.http.middlewares.stripprefix-rest.stripprefix.prefixes = / rest”
  • “ traefik.http.routers.aideopp-ws.middlewares=stripprefix-rest@docker

这对我使用Docker Swarm有用。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...