-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How Routing traffic depending on path not domain in docker #706
Comments
very curious about this also, to route traffic to different api version ... |
What is not working exactly? Have you tried |
@emilevauge I have tried using this - "traefik.frontend.rule=Path:echo-echo./echo" I can't see the documentation of "PathPrefix" or "PathPrefixStrip" |
@emilevauge thanks Finally got it, it wasn't so obvious from the documentation ---
traefik:
command: "--web --docker --docker.domain=docker.localhost --logLevel=DEBUG"
image: traefik
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/dev/null:/traefik.toml"
whoami1:
image: emilevauge/whoami
labels:
- traefik.backend=whoami
- "traefik.frontend.rule=Host:whoami.docker.localhost"
whoami2:
image: emilevauge/whoami
labels:
- traefik.backend=whoami2
- "traefik.frontend.rule=Path:/test2/, _/mwas/_" |
@emilevauge quick question how does one do regex for path in traefik for example for certain domain I want to forward trafic with this path foo to containerB and the container with path boo to containerC and empty path to containerD |
Hi Guys, I am trying to do the same but cannot make it work. web:
image: nginx
links:
- app
volumes_from:
- app
volumes:
- ./web/nginx.conf:/etc/nginx/nginx.conf
labels:
- "traefik.backend=web"
- "traefik.frontend.rule=Host:mydomain.dev"
- "traefik.port=80"
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- db
labels:
- "traefik.backend=phpmyadmin"
- "traefik.frontend.rule=Host:mydomain.dev;Path:/pma" Anyone having an idea how to solve this? Thanks |
@romainlaisne I use this label |
Hi, I haven't solved my issue yet, but I think that it is not Traefik causing me trouble in the end. Thanks for you help @mwaaas. |
@romainlaisne Did you find a solution for you mydomain.dev/pma problem? I've got the same problem. |
@romainlaisne Found the answer, use "traefik.frontend.rule=Host:mydomain.dev;PathPrefixStrip:/pma" |
Solution for me: I tried something similar to:
But figured out, this does not work. (Maybe line 1 does overwrite line 2?) For me worked:
|
I was looking for path based routing as well and I finally made it working like following referring to all above conversation and official document.
The only caveat is it works with http://mydomain.com/xxx/ but doesn't work without last slash like http://mydomain.com/xxx |
I have tried this and its not working
The text was updated successfully, but these errors were encountered: