I am attempting to use Traefik as a proxy to send traffic to gitlab review environments. Gitlab CI can start docker containers to run a review version of a project. I can get Traefik to detect these containers, and route trafic to them with this kind of config in my docker-compose file:
- traefik.gitlab.frontend.rule=Host:gitlab.example.local;PathPrefixStrip:/review/$CI_BUILD_REF_NAME.$CI_PROJECT_NAME.$CI_PROJECT_NAMESPACE
- traefik.gitlab.port=80
With this I can open "https://gitlab.example.local/review/master.project.user/ping", and get my PONG page. But if I go to "https://gitlab.example.local/review/master.project.user/", the simple test app I am using will return a 303 redirect to /ping which ends up as "https://gitlab.example.local/ping", and is not proxied to the review app.
> GET /review/master.10112.root HTTP/2
> Host: gitlab.example.local
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 303
< content-type: text/html; charset=utf-8
< date: Mon, 25 Feb 2019 08:25:44 GMT
< location: /ping
< content-length: 32
<
<a href="/ping">See Other</a>.
The documentation mentions a "X-Forwarded-Prefix" header being set. I'm not sure if it is actually set. I cant see this in a curl -V. Is it the case that I need to have an app that detects this header and prepends it as a "base path" to its responses? Is there a way to configure Traefik to add this to the returning path?
Are there any other more configurable Docker aware proxies out there that I could use to route traffic to dynamically addressed gitlab review environments?