basically how this will look like in traefik if it is possible:
location /blog/ {
proxy_pass https://blog.example.com/;
proxy_redirect https://blog.example.com/ https://www.example.com/blog/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host blog.example.com;
}
I tried, this config in my docker-compose:
- 'traefik.frontend.redirect.regex=^https://example.com/blog/(.*)$$'
- 'traefik.frontend.redirect.replacement=https://blog.example.com/$$1'
this does work, but it just redirects, to https://blog.example.com
, I want to keep original url https://example.com/blog/
and show content from https://blog.example.com
.
is it possible to achieve with the traefik?
In Traefik, that redirect label is for interaction with client (sending your browser to another location)
I am still trying to figure out what is the exact replacement for proxy_redirect. As per Nginx docs, this directive:
So in docker-compose.yaml those two header fields could be placed like this:
But I'm not sure how to replace them with regex. Maybe there is a more "traefikal" approach out there.
I know this isn't a real answer, but I can't post a comment due to my low points.
I found your question while looking for a solution for Jenkins behind Traefik SSL.