My remote api is receiving requests with the Host "0.0.0.0" and therefore it is unable to route my request. Is there a way to tell the loadbalancer to use a specified Host header?
I've tried a few things including a middleware to add a custom Host header but it did not work.
First, When you are using curl locally, curl will use your target host (in this case 0.0.0.0) and it will use it as the host header.
If you want to use a specific host header, add a DNS entry for it into your local DNS resolver or host file, like 127.0.0.1 example.com, and then use example.com/remote_api as your request.
Note that if you use a custom host like example.com, you will need to ensure that your traefik router matches the host you are sending.
Secondly: When you set a backend URL that is a DNS name, the backend request will be made with that host header. Otherwise the backend request would not work properly.
If you want to proxy to a remote site, while preserving the original request host header, the backend URL has to be IP-based.