As applications grow, change becomes unavoidable. APIs evolve, services move to containers, and legacy systems are gradually modernized. The real challenge is not updating the backend itself, but doing it without breaking existing URLs or frontend integrations.
For a long time, teams solved this problem by using reverse proxies like NGINX or by adding rewrite logic directly into application code. While these approaches work, they also introduce extra infrastructure, more configuration, and higher operational overhead.
AWS has now introduced a cleaner and simpler solution:
Native URL and host header rewrite support in Application Load Balancers (ALB).
This feature allows you to rewrite request paths and host headers directly at the load balancer layer, with optional regex support, without changing application code or deploying additional proxy services.
In this blog, we explain what this feature is, why it matters, and how it can simplify real-world architectures.
AWS Application Load Balancer operates at Layer 7 (the application layer) and routes HTTP and HTTPS traffic to backend targets such as EC2 instances, containers, or serverless services.
Traditionally, ALB could route traffic based on:
However, it could not modify the request itself.
With the latest update, ALB can now:
This makes ALB a much more capable and flexible request processing component.
Before native rewrite support was available, teams usually had two choices.
Rewriting URLs directly inside application code.
Placing a proxy in front of the application.
Both approaches add complexity.
With native ALB rewrite:
This results in:
Faster and safer migrations
ALB now processes incoming requests in three clear steps.
Conditions determine whether a rule applies to a request. Matching can be done using:
Regex matching is now supported for these conditions.
Transforms allow ALB to modify the request before it reaches the backend. You can:
All of this happens inside the ALB, without the backend being aware of it.
Finally, ALB forwards the modified request to the appropriate target group.
Regex support significantly reduces the number of listener rules required.
Without regex support:
en.example.comfr.example.comes.example.comWith regex support, a single rule can be used: ^(en|fr|es)\.example\.com$
One rule replaces many.
Regex matching can be applied to:
This improves readability, reduces duplication, and lowers the chance of configuration errors.

URL rewrite is one of the most powerful and commonly used features.
A client sends a request to: https://example.com/app1/orders/123
ALB rewrites the request internally to: /site1/orders/123
The backend application receives: /site1/orders/123
The client URL remains unchanged.
Regex makes it possible to perform dynamic rewrites while preserving subpaths.
Match: ^/app1/?(.*)$
Replace: /site1/$1
/app1/app1//app1/test/app1/api/v1/usersAll of these are handled natively by ALB.
Some applications rely on the Host header for correct behavior, such as:
Client sends: Host: api.example.com
ALB forwards: Host: service.internal.local
The real power of this feature comes from combining multiple capabilities:
This enables advanced scenarios such as:
All without touching application code.
Native ALB rewrite is especially useful for:
For many teams, ALB alone is now sufficient.
Native URL and host header rewrite in AWS Application Load Balancers is a meaningful improvement for modern cloud architectures.
It eliminates the need for extra proxies, simplifies migration strategies, and gives teams precise control over request routing, all while staying within AWS-managed infrastructure.
If you are still using reverse proxies solely for path or host rewrites, this feature is well worth adopting.
We use cookies to enhance your browsing experience, analyze traffic, and serve personalized marketing content. You can accept all cookies or manage your preferences.