Terminating Gateway does not set Host Header

As described in this issue, Terminating Gateways currently do not rewrite Host header when proxying the requests, resulting in some load balancers returning 404 when you “naively” curl them:

/ $ curl http://localhost:8443/
404 page not found
/ $ curl --header "Host: api.redacted.ai" http://localhost:8443/
redacted is healthy

I tried to take a stab at implementing a fix here but it doesn’t seem to work.

Any guidance on how I could implement this? This will greatly help enhance the ergonomics of using terminating gateways.

Hi @lawliet89,

This is a reasonable feature request, and we would like to support this in a future release.

Please keep an eye on the GitHub issue for updates on this feature request.

Thanks for your reply. I have actually attempted a PR (https://github.com/hashicorp/consul/pull/9042) and it’s awaiting comments/review.