How to use traefik to proxy a https request to an external server?

I am new to traefik and using v2.0. I am trying to replace one of our custom api gateway with traefik's community version. Our main requirement is to proxy an incoming HTTPS request to another external domain using HTTPS protocol. For example, my incoming request is and I want to proxy that request to I tried with redirect middleware, it works with a redirect. When I send request to traefik, it returns 301/302 error with the and the browser redirects the call to However, in our use case, we don't want the redirect. The request should pass through traefik and It should rewrite the URL. I spend quite some time reading the documentation but have had no luck so far. Is it possible to meet the requirement using traefik and if so, how can I do it?

I found a solution to address this issue. I am putting my steps to help other community members.

The Host header of the request should be the new domain. The most application load balancer uses host-based routing policy. Therefore, the routing to the new location fails if the Host header is not the right one. Here is the configuration for the "Hello world" version of the scenario. Traefik is using the file provider and routing to

Static Config:

    address: :80
    address: :8080
  providersThrottleDuration: 2s
    directory: /backend-services/
    watch: true
  insecure: true
  level: DEBUG

Dynamic config file
The file is saved at /backend-services/ location and give the file extension .yml

              Host: ""

          entryPoints: ["web"]
          rule: "Host(``)"
          service: "yahoo-svc"
          - "yahoo-Header"

            - url: ""

Nice work Manideep. I'm looking to create an internal traffic splitter that could send traffic through one of two proxies depending on the domain name in the url. You're solution appears to work for (http and https?) do you know if you found a way to wildcard it for all traffic... through traefik :joy:

Thanks and well done :+1:

I'm so happy I found this as I was having this problem as well. But It doesn't appear to work with all sites.
For example I'm trying to do this with a Google Doc which redirects me to signup and Notion document throws an error: "Mismatch between origin and baseUrl (dev)."

I'm assuming this is some sort of protection against a transparent reverse proxy.

Would you be able to make this work for a Google Doc link that has public access enabled?