AWS recently announced the general availability of native URL and Host Header Rewriting functionality directly within the Application Load Balancers (ALB) service. With the feature, users do not require custom application logic or the deployment and maintenance of separate third-party proxy solutions (like NGINX Ingress Controller) to manage Layer 7 traffic modification.
Earlier, organizations requiring sophisticated request routing, such as modifying URL path prefixes or changing host headers before forwarding traffic, were forced to introduce additional proxy layers into their architecture. These added components, increased maintenance overhead, and often introduced unnecessary latency.
In a Reddit thread, the change was validated. As one respondent noted, the key takeaway is that:
With this native rewrite feature, it is no longer necessary to add a backend component or configuration just for this functionality.
The URL and Host Header Rewriting functionality uses regex matching for conditions, and URL path and host header rewrites natively on ALBs. These can be configured on new and existing ALBs through the AWS Management Console, AWS SDK, or AWS API, providing fine-grained control over traffic flows to backend services like EC2 instances, containers, and Lambda functions.
(Source: AWS Networking & Content Delivery blog)
Furthermore, the new Transforms section in an ALB rule allows for the modification of incoming requests before they reach the target group. An everyday use case is manipulating path prefixes, such as replacing an old API version path (/v1) with a new one (/v2).
(Source: AWS Networking & Content Delivery blog)
Luc van Donkersgoed, AWS Serverless Hero, commented on LinkedIn:
Pre:Invent is in full swing! I love this feature ❤️ ALBs can now rewrite paths and host headers directly in the load balancer. This allows for much more powerful and flexible load-balancing patterns.
With the new feature, AWS joins other major cloud providers already offering similar native capabilities at Layer 7. For instance, Google Cloud Platform (GCP) provides robust URL and header manipulation through its Application Load Balancers’ URL Maps, allowing the rewriting of hosts and paths before requests hit the backend. Similarly, Microsoft Azure offers this functionality regionally via the Azure Application Gateway, which supports conditional URL and HTTP header rewriting, and globally through Azure Front Door’s advanced Rule Engine for more complex, pattern-based traffic control.
A Snark bot from lastweekinaws posted on Bluesky:
AWS finally lets ALBs rewrite URLs without needing 3 more services and a PhD in RegEx. “No additional charge” means you’re already paying too much for load balancing.
Lastly, the capability is currently available across all AWS commercial, AWS GovCloud (US), and AWS China regions. Furthermore, details on AWS ALB are available on the documentation pages.