lyft / presto-gateway

A load balancer / proxy / gateway for prestodb
Apache License 2.0
358 stars 156 forks source link

Setting forwarded host correctly #131

Closed ssanthanam185 closed 3 years ago

ssanthanam185 commented 3 years ago

Presto Uses "X-Forwarded-Host" to determine the nextURi & InfoURI. These headers are set correctly on the outgoing Proxy request as we are using ProxyServlet.Transparent . Reference : https://github.com/lyft/presto-gateway/blob/master/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServletImpl.java

This PR explicitly sets the Host Header to the host name of the backend presto cluster vs preserving the Host of the gateway itself. This ensures that we dont run into 400 Bad request Issues if there is an LB fronting the backend Presto cluster.

ssanthanam185 commented 3 years ago

👀 @reverson