docker - ProxyPass/ProxyPassReverse 与 Traefik
问题描述
我想在 Docker Swarm 中将 apache/tomcat ProxyPass 配置更改为 traefik/tomcat 配置。我在这里尝试了一些解释https://docs.traefik.io/basics/#frontends,但它不起作用:
阿帕奇配置:
ProxyPass /sso ajp://server_host:8080/app
ProxyPassReverse /sso ajp://server_host:8080/app
Docker Swarm 配置:
Traefik config in my docker-compose file:
traefik.frontend.rule=Host:external_dns;PathPrefix:/sso;ReplacePath:/app
以及带有战争应用程序的docker映像中的tomcat(上下文“app”)
但它不起作用,/sso
被重定向(302)到/app
谁可以做从前端到后端的重定向?
谢谢
解决方案
修改参数后问题解决ReplacePathRegex
:
traefik.frontend.rule=Host:external_dns;PathPrefix:/sso;ReplacePathRegex:^/sso/(.*) /app/$$1
推荐阅读
- python - Pandas 读取 excel 错误“列表”对象没有属性“set_names”
- python - 将嵌套循环转换为列表理解
- javascript - 如何围绕其轴旋转三个js中的对象?
- html - 如何创建单选按钮的下拉列表
- symfony - Sylius:添加自定义表单类型问题
- reactjs - reactjs语义ui图像src不使用反引号示例(`$ {myvalue}`)
- indexing - Couchbase 数组索引
- python - Matplotlib 中特定位置的垂直网格线
- c# - ClaimRequirementFilter - TypeFilterAttribute 处理
- php - Symfony,性能失败。在一个路径上运行繁重的脚本时,其他路径变得无法访问