I want to rewrite host header so that AWS Load Balancer doesn’t reject my requests
What steps have you taken to resolve the issue?
I’ve tried to create a transform rule, but it didn’t allow me to rewrite host header.
Origin rule is enterprise only which we don’t have.
Can I use snippet to rewrite host header?
While you cannot override host header for the original request, you can still fetch content from AWS LB using a fetch subrequest in Snippets. Feel free to use this example as a reference. This will work if your LB accepts requests for its own hostname (i.e. my-loadbalancer-1234567890.us-west-2.elb.amazonaws.com).
In the future, we’re considering adding load balancers to Cloud Connector to simplify this setup.
All paid accounts already have access to Snippets in alpha, so if you are on a Pro plan or higher you should see it under the Rules tab of your dashboard. Currently there are no immediate plans to offer Snippets to free accounts.
Load Balancer allows to configure Host header for endpoints, however the Host header must either be a subdomain of a zone associated with this account, must match the endpoint address, or must publicly resolve to the endpoint address.