Amazon API Gateway now supports routing rules for REST APIs
Amazon API Gateway now supports routing rules for REST APIs using custom domain names. This new capability enables you to dynamically route incoming requests based on HTTP header values, URL base paths, or a combination of both.
This flexibility enables various use cases, including A/B testing, API versioning, and dynamic backend selection. You define routing rules through conditions (HTTP headers, URL paths, or both), actions, and priorities. API Gateway then evaluates these rules in priority order with lower numbers taking precedence. When a request meets all conditions in a rule, API Gateway routes it to a specific REST API ID and stage. By implementing routing logic directly within API Gateway, you can eliminate proxy layers and complex URL structures while maintaining granular routing control over your API traffic. This feature supports both public and private REST APIs and is compatible with existing api-mappings.
Routing Rules for custom domains is now available on API Gateway in Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD. Please visit the API Gateway documentation to learn more.