All Products
Search
Document Center

Server Load Balancer:Listener forwarding rules

Last Updated:Aug 28, 2026

This topic explains how to configure forwarding rules for an Application Load Balancer (ALB) listener to route client requests to different backend server groups based on conditions, and to process backend responses before returning them to the client.

Forwarding rules

You can add multiple forwarding rules to a listener for an ALB instance. A forwarding rule consists of conditions and actions. Conditions define what to match in a request or response, and actions define what to do when a match is found.

Forwarding rules are classified as either inbound forwarding rules or outbound forwarding rules based on traffic direction. Basic and Extensible edition instances support only inbound forwarding rules. Standard and WAF-enabled instances support both inbound and outbound forwarding rules.

In addition to conditions and actions, ALB Extensible Edition instances also support enhanced capabilities such as token-based throttling, authentication, MCP proxy, dynamic forwarding, and load-aware routing through service extensions.

image
  • For Standard and WAF-enabled editions of ALB instances, when a client sends a request to ALB, ALB processes the request data based on an inbound forwarding rule and sends the data to the corresponding backend server. The response data from the backend server is then processed by an outbound forwarding rule on ALB and returned to the client.

  • Inbound forwarding rule: You can configure only inbound conditions and actions.

  • Outbound forwarding rule: You can configure outbound conditions and actions. You can also add inbound conditions.

Each forwarding rule must include a Forward, Redirect, or Return Fixed Responses action to ensure that client requests are not interrupted.

Table 1. Forwarding rules supported by Basic instances

Direction

Condition

Actions

Inbound

Domain Name, Path, and HTTP Header

Forward to and Redirect to

Table 2. Forwarding rules supported by Standard and WAF-enabled instances

Direction

Condition

Actions

Inbound

Domain Name, Path, HTTP Header, Query String, HTTP Request Method, Cookie, and Source IP.

Forward to, Redirect to, Return Fixed Response, Rewrite, Insert Header, Remove Header, Rate Limit, Mirror traffic to, and CORS.

Outbound

  • Inbound conditions (optional): Domain Name, Path, HTTP Header, Query String, HTTP Request Method, Cookie, and Source IP.

  • Outbound conditions: Response Status Code and Response Header.

Return Fixed Response, Insert Header, and Remove Header

Table 3. Forwarding rules supported by Extensible Edition instances

Direction

Condition

Service extension

Actions

Inbound

Domain Name, Path, HTTP Header, and AI Model.

Token Rate Limiting, API Key Authentication, JWT Authentication, MCP Proxy, Dynamic Forwarding, and Load-Aware Routing.

Service extensions that contain the Dynamic Forwarding or Load-Aware Routing component cannot be associated with forwarding rules.

Forward to, Redirect to, Return Fixed Response, Rewrite, Insert Header, Remove Header, and Fallback.

Matching principle

Matching policy: ALB evaluates each client request against forwarding rules by priority. A smaller rule number indicates a higher priority. When a request matches all conditions of a forwarding rule, ALB performs the rule's action and stops evaluating subsequent rules.

  • If an inbound client request does not match any custom forwarding rule, the default forwarding rule processes the request.

  • If an outbound response does not match any forwarding rule, ALB returns the response directly to the client.

ALB evaluates forwarding rules strictly by their priority and does not automatically sort them based on the specificity of domain names or paths. If you want requests to be matched against more specific rules first, such as those with an exact domain name, you must manually assign a lower priority number to those rules than to rules with wildcards or regular expressions. This matching principle differs from Nginx, which uses longest prefix matching, and from CLB, which automatically sorts rules by domain name specificity.

Default forwarding rule: After you create a listener, the system automatically creates a default forwarding rule for inbound traffic. The forwarding condition for this rule is -, which matches all client requests. Its forwarding action is to forward traffic to the server group configured for the listener.

  • You cannot delete the default forwarding rule, but you can change the server group in its forwarding action.

  • The default forwarding rule has the lowest priority, and its priority cannot be changed.

  • The default forwarding rule of an ALB Extensible Edition instance cannot be associated with service extensions. As a result, you cannot configure enhanced capabilities, such as token-based throttling and authentication, for the default forwarding rule, and it cannot forward traffic to server groups of the MCP service type.

The ID of a default forwarding rule is in the format rule-default-<listener name>. The ID of the default forwarding rule is not displayed in the forwarding rule list in the console. However, you can filter log entries by this ID in ALB access logs to view the requests forwarded by the default forwarding rule.

If you need a more flexible catch-all rule to handle unexpected requests, you can create a forwarding rule with the path condition set to /*, which matches all paths. For the action, configure the rule to Return Fixed Responses with a status code of 404 or 403. After creating the rule, drag it to the second-to-last position in the rule list, just before the default rule.

Logical relationships between forwarding conditions: A logical AND applies between different types of conditions, and a logical OR applies between multiple values of the same condition type.

  • AND logic between different conditions: For example, if a rule has a domain name condition of *.example.com and a path condition of /api/*, an incoming request must meet both conditions to match the rule.

  • OR logic between multiple values: For example, if you add two values to the domain name condition, www.example.com and www.test.com, a request will satisfy the condition if its domain name matches either value.

The following example illustrates how multiple forwarding rules are evaluated:

Priority

Forwarding condition

Forwarding action

Description

1

Domain name: api.example.com, Path: /v2/*

Forward to server group A

Exact domain name + wildcard path, highest priority.

2

Domain name: api.example.com, Path: /*

Forward to server group B

Exact domain name + all paths, second-highest priority.

3

Domain name: *.example.com

Forward to server group C

Wildcard domain name, third-highest priority.

Default

- (matches all requests)

Forward to server group D

Catch-all rule, lowest priority.

  • A request for api.example.com/v2/users matches rule 1, which forwards it to server group A.

  • A request for api.example.com/v1/users does not match rule 1 because the path does not match /v2/*. It matches rule 2, which forwards it to server group B.

  • A request for web.example.com/index does not match rule 1 or 2 because the domain name is different. It matches rule 3, which forwards it to server group C.

  • A request for other.com/page does not match any custom rules, and the default forwarding rule forwards it to server group D.

Prerequisites

Add a forwarding rule

When you create a listener, you define its default forwarding rule. You can also add more forwarding rules after the listener is created.

  1. Go to the Instances page in the ALB console, and then click the ID of the target instance.

  2. Click the Listener tab, find the target listener, and then click View/Modify Forwarding Rule in the Actions column.

  3. On the Forwarding Rules tab, select Inbound Forwarding Rules or Outbound Forwarding Rules, click Add New Rule, configure the following parameters, and then click Save.

Inbound rules

Rule Name

Optional. If you leave this parameter empty, the system automatically generates a name.

Add Condition

Select a condition type to add one or more of the following conditions. You can also click Add Condition to add multiple conditions.

  • Domain Name: Add one or more domain names. A domain name must be 3 to 256 characters in length and can contain wildcard characters, including asterisks (*) and question marks (?). An asterisk (*) matches any string of characters, and a question mark (?) matches a single character. Supported match types include exact match, wildcard match, and regular expression match. For more information about domain name configuration rules, see Forwarding rule configuration examples and domain name and path matching rules.

    • Exact match: The request domain name must be an exact match for the specified domain name, for example, www.example.com.

    • Wildcard match: Use an asterisk (*) to match any string of characters, including dots (.), and a question mark (?) to match a single character. For example, *.example.com can match api.example.com and www.example.com.

    • Regular expression match: Use a regular expression for domain name matching. The matching is case-insensitive. For example, ^www\.example\.(com|cn)$ can match domain names that end with .com or .cn.

  • Path: Add one or more paths. Both regular expression paths and non-regular expression paths are supported. For more information about path configuration rules, see Forwarding rule configuration examples and domain name and path matching rules.

    • Exact match: For example, /api/v1/users matches only the exact path.

    • Wildcard match: For example, /api/* matches all paths that start with /api/, including subpaths. /* matches all paths. Path matching is case-sensitive.

      When a client accesses a domain name directly without specifying a path, for example, http://example.com, ALB treats it as the path / for matching. Therefore, /* also matches such requests without a path.
    • Regular expression match: For example, ^/api/(.*)/list$ matches paths that start with /api/ and end with /list. You can choose whether the matching for regular expression paths is case-sensitive.

  • HTTP Header: Enter the HTTP header name in the Key field and its value in the Value field. You can add multiple header values. The header key must be 1 to 40 characters in length and can contain only letters, digits, underscores (_), and hyphens (-). The matching is case-insensitive. The header value must be 1 to 128 characters in length and can contain printable characters. The value cannot start or end with a space. You can use wildcard characters, including asterisks (*) and question marks (?).

    Example: Key is user-agent, and Value is *Mozilla/4.0*. This configuration matches all requests where the value contains Mozilla/4.0.

  • Query String: Add one or more key-value pairs for the query string. The key must be 1 to 100 characters in length and the value must be 1 to 128 characters in length. You can use visible characters such as lowercase letters (although the input accepts only lowercase letters, the matching is case-insensitive), asterisks (*), and question marks (?). Spaces and special characters such as #[]{}\|<>& are not supported.

    Example: If the URL is www.example.com/test/test1?x=1&y=2, you can configure the condition as x:1 or y:2.

  • HTTP Request Method: Add one or more HTTP request methods. Valid values are HEAD, GET, POST, OPTIONS, PUT, PATCH, and DELETE.

  • Cookie: Add one or more cookies. The key must be 1 to 100 characters in length and the value must be 1 to 128 characters in length. You can use visible characters such as lowercase letters (although the input accepts only lowercase letters, the matching is case-insensitive), asterisks (*), and question marks (?). Spaces and special characters such as []{}<>\#|& are not supported.

    Example: Key is key and Value is value.

  • Source IP: Add one or more IP addresses or CIDR blocks. CIDR blocks in the format of 0.0.0.0/x, where x is a digit, are not supported.

    Example: 192.168.1.1/32

  • AI Model: Supported only by ALB Extensible Edition instances. ALB extracts the model protocol and model name from the request body for matching, and then proxies the request to the corresponding backend service (an AI service or a self-managed LLM service), without requiring any modification on the business side.

    • Protocol: Defaults to OpenAI compatible, which includes three routes: /v1/completions, /v1/chat/completions, and /v1/embeddings. Business traffic that matches this protocol is forwarded to the backend service.

    • Model Name: Optional. If you specify a model name, requests can be matched and forwarded to the corresponding backend service based on the model name. Model names are matched using Glob syntax. You can add multiple model names, and the OR logic applies between them.

    In a single forwarding rule, the AI Model and Path conditions are mutually exclusive. You can configure only one of them in a rule.
    When forwarding is based on the model name, in the inbound Insert Header and Remove Header actions, you cannot set the header field name to x-alb-model, which is a system-reserved field of ALB.

Action

Select an action type to add one or more of the following actions. You can also click Add Action to add multiple actions.

  • Forward to: Select a target server group from the list. Supported server group types are Server, IP Address, and Function Compute. If the instance edition is Extensible, the FQDN, AI Service, MCP Service Type, and IP Address Range server group types are also supported. You can add multiple server groups and set a Weight for each server group to control the traffic distribution ratio. By default, the weight of a single server group ranges from 0 to 100. If you add multiple server groups, you can enable Session Persistence for Server Groups. To use this feature, you must enable session persistence for all added server groups.

    When you add multiple server groups, you can select server groups that use different backend protocols, such as HTTP and HTTPS.
    The maximum weight of a single server group can be increased to 10,000. To request this increase, contact your account manager.
    A server group of the IP Address Range type is a component for implementing dynamic forwarding and is used to limit the range of destination addresses allowed for dynamic forwarding. This type of server group can be used only after it is associated with a service extension that contains the dynamic forwarding component.
    After you select a server group of the MCP service type, the entire forwarding rule is subject to the following restrictions to comply with the MCP protocol specifications: The conditions support only Domain Name and Path. The actions support only Forward to, Insert Header, and Remove Header. You can select only one server group of the MCP service type, and it cannot be used together with server groups of other types. It must be associated with a service extension that contains the MCP proxy component.
  • Redirect to: From the Protocol and Status Code drop-down lists, select a protocol and a status code. Then, specify the destination Domain Name, Port, Path, and Search. You must specify a non-default value for at least one of these parameters: Protocol, Domain Name, Port, Path, or Search.

    For more information about advanced configuration rules for the Path parameter in the Redirect to action, see Advanced path configuration for rewrites and redirects.
    The default values of fields, such as ${host}, ${path}, ${port}, ${protocol}, and ${query}, refer to the corresponding values in the request. The path field supports only references to ${host}, ${path}, ${port}, and ${protocol}, and regular expression capture group variables such as ${1}, ${2}, and ${3}. Other $ variables are not supported.
    For more information about status codes, see Standard HTTP status codes.
  • Return Fixed Response: Enter a Response Status Code. You can also specify the Response Content Type (Optional) and Response Content (Optional). The response status code must be a numeric string in the 2xx, 4xx, or 5xx format, where x is a digit.

  • Rewrite: Modifies the Domain Name, Path, or Search of a request to a specified value before the request is forwarded to a backend server. The URL in the client's browser address bar does not change.

    The Rewrite action takes effect only when it is used with the Forward to action.
    Difference between Rewrite and Redirect to: A rewrite is an internal ALB operation that changes the path received by the backend server. The client URL remains unchanged. A redirect returns a 3xx status code that causes the client's browser to navigate to a new URL.
    Example: To rewrite /app/page to /v2/page, set the path condition to /app/page with the exact match method and set the rewrite path to /v2/page. To match and rewrite all subpaths under /app/, use a regular expression. For more information, see Advanced path configuration for rewrites and redirects.
    In a rewrite path, the $ character can be used only to reference the following variables: ${host}, ${path}, ${port}, ${protocol}, and regular expression capture group variables, such as ${1}, ${2}, and ${3}. Other variables are not supported.
  • Insert Header: Enter a header name and value. This action overwrites any existing request header with the same name. The header key must be 1 to 40 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The header value must be 1 to 128 characters in length and can contain letters, digits, and common punctuation marks. The value cannot start or end with a space.

  • Remove Header: Enter a header name to remove the corresponding key-value pair from the request header.

    When you use the inbound Insert Header and Remove Header actions, you cannot specify the following header names. The matching is case-insensitive. These headers are reserved by ALB or are critical to the HTTP protocol. Modifying them may cause request forwarding errors or connection interruptions. slb-id, slb-ip, x-forwarded-for, x-forwarded-proto, x-forwarded-eip, x-forwarded-port, x-forwarded-client-srcport, x-forwarded-host, connection, upgrade, content-length, transfer-encoding, keep-alive, te, host, cookie, remoteip, and authority.
  • Rate Limit: Configure the following parameters based on your business requirements.

    • QPS (Total): Specify the number of queries per second. Valid values: 1 to 1,000,000.

    • QPS (Per Client IP): Specify the QPS limit for each source IP address. Valid values: 1 to 1,000,000. If you configure both QPS (Total) and QPS (Per Client IP), the value of QPS (per Source IP) must be less than the value of QPS (Total Limit).

    The Rate Limit action must be used with the Forward to action. Requests that are within the QPS limit are forwarded to the target server group. By default, ALB returns a 503 status code for requests that exceed the QPS limit. Alternatively, you can add a Redirect to or Return Fixed Response action to handle these requests.
    If you enable QPS (Per Client IP), ALB retrieves the source IP address from the X-Forwarded-For header. If requests pass through multiple proxies, enable Retrieve Client IP for the listener to ensure that ALB obtains the correct client source IP address. For more information, see Create and manage listeners.
  • Mirror traffic to: Select a target server group from the list. You can select Server or IP Address server groups.

  • CORS: Configure a Cross-Origin Resource Sharing (CORS) policy. ALB automatically handles OPTIONS preflight requests and returns CORS response headers. As a result, backend servers do not need to process CORS requests. The CORS action is easier to configure than using the Insert Header action to manually configure response headers such as Access-Control-Allow-Origin.

    What is CORS?

    A cross-origin request is a request for a resource from an origin (domain, protocol, or port) different from that of the current page. Requests include simple requests and preflight requests. The CORS action is suitable for scenarios where frontend and backend services are decoupled. For example, if the frontend is deployed at www.example.com and the API service is deployed at api.example.com, cross-origin restrictions are triggered when the frontend calls the API from a browser.

    • Trusted Origins: Specify the origins from which browsers are allowed to access your resources.

    • Trusted Methods: Select the HTTP methods that are allowed for cross-origin requests. Valid values: GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH.

    • Trusted Request Headers: Specify the headers that are allowed in cross-origin requests in addition to the basic headers supported by browsers.

    • Trusted Response Headers: Specify the response headers that can be accessed by browsers and JavaScript.

    • Trusted Credentials: Specify whether to allow credentials to be included in cross-origin requests. The default value is Allow.

    • Browser Cache Time: For preflight requests, specify the maximum period of time for which the results of an OPTIONS preflight request can be cached in the browser. Unit: seconds. Valid values: -1 to 172800.

    We recommend that you use a Domain Name condition for a CORS rule. This prevents preflight requests (OPTIONS), whose method and headers differ from the actual request, from matching a different rule and causing the CORS configuration to fail. Distinguish between the two domain names: set Domain Name to the target domain name, for example, api.example.com, and set Trusted Origins to the source domain name, for example, www.example.com. For more information, see CORS FAQ.
  • Fallback: Supported only by ALB Extensible Edition instances. When a backend service returns any HTTP 4xx or 5xx error status code (the status codes are preset by the system and cannot be customized), ALB automatically retries the request on backup server groups. You can select one or more backup server groups. If you select multiple groups, ALB tries them in ascending order of their sequence numbers. When falling back to a service that is compatible with the OpenAI protocol, ALB can pass through the model name or rewrite the model name in the request body.

    The Fallback action must be used with the Forward to action and is executed after the Forward to action.
    All server group types except the MCP Service Type type can be used as fallback services.

Service Extension (Optional)

Supported only by ALB Extensible Edition instances. Service extensions provide ALB with personalized traffic processing and flexible extension capabilities through plugins or external service calls. Built-in components include Token Rate Limiting, API Key Authentication, JWT Authentication, MCP Proxy, Dynamic Forwarding, and Load-Aware Routing. An inbound forwarding rule can be associated with one service extension, which takes effect immediately after association. The service extension is executed between the conditions and the actions.

For more information about the components, configuration steps, quotas, and billing of service extensions, see Service Extensions.

Service extensions that contain the Dynamic Forwarding or Load-Aware Routing component cannot be associated with forwarding rules.

Outbound rules

Basic and Extensible edition instances do not support outbound forwarding rules.

Rule Name

Optional. If you leave this parameter empty, the system automatically generates a name.

Inbound Conditions (Optional):

Select one or more inbound conditions. You can also click Add Inbound Condition to add multiple conditions. For information about how to configure each condition, see the Inbound forwarding rules tab.

If you configure a Rewrite action in an inbound forwarding rule, the inbound conditions (such as Domain Name, Path, and Query String) that you add to an outbound forwarding rule must match the rewritten values, not the original values from the client request. For example, if the inbound rule rewrites the path from /app/page to /v2/page, you must set the path condition in the outbound rule to /v2/page.

Outbound Conditions

Select one or more outbound conditions. You can also click Add Outbound Condition to add multiple conditions.

  • Response Status Code: The status code in the response to the client. Valid values: 100 to 599. You can specify a range. Separate multiple status codes and ranges with commas (,), for example, 200-233,301.

  • Response Header: An HTTP header in the backend response. Enter the HTTP header name in the Key field and its value in the Value field. You can add multiple headers.

Action

Select an outbound action type. You can also click Add Action to add multiple actions.

  • Return Fixed Response: Enter a Response Status Code. You can also specify the Response Content Type (Optional) and Response Content (Optional). The response status code must be a numeric string in the 2xx, 4xx, or 5xx format, where x is a digit.

  • Insert Header: Enter an outbound header name and value. This action overwrites any existing response header with the same name.

  • Remove Header: Enter an outbound header name to remove the corresponding key-value pair from the response.

    When you use the outbound Insert Header and Remove Header actions, you cannot specify the following header names. The matching is case-insensitive. These headers are critical to the HTTP protocol. Modifying them may cause response transmission issues. connection, upgrade, content-length, and transfer-encoding.

AScript

You can click Add Script Before Forwarding Rule Is Applied or Add Script After Forwarding Rule Is Applied to add an AScript programmable script forwarding rule. AScript is supported only by ALB instances of the Standard and WAF-enabled editions. The Basic and Extensible editions do not support AScript.

The AScript feature is in whitelist release. To add or modify scripts, contact your account manager.

API

  • Call the CreateRule operation to create a forwarding rule.

  • Call the CreateRules operation to create forwarding rules in batches.

Manage forwarding rules

Warning

Editing, deleting, or adjusting the priority of a forwarding rule may disrupt existing traffic. We recommend you perform these operations during off-peak hours, after thoroughly evaluating and testing the required changes.

Console

  1. Navigate to the Instances page in the ALB console and click the ID of the target instance.

  2. Click the Listener tab, find the target listener, and click View/Modify Forwarding Rule in the Actions column.

  3. On the Forwarding Rules tab, select Inbound Forwarding Rules or Outbound Forwarding Rules, and do one of the following:

    • Edit a forwarding rule: Find the desired rule, click Modify in the upper-right corner, modify the settings, and then click Save.

    • Delete a forwarding rule: Find the desired rule, click Delete, and then click Delete in the confirmation dialog box. The default forwarding rule cannot be deleted. Deleting a listener also deletes all of its forwarding rules.

    • Adjust forwarding rule priority: Drag the rule to the desired position and click Save Priority Changes. ALB matches requests against forwarding rules in ascending order of priority. You cannot adjust the priority of the default forwarding rule.

API

Billing

While forwarding rules do not incur direct fees, the number of rules affects the rule evaluation count, which in turn contributes to the LCU fee for an ALB instance. For more information, see ALB billing rules.

Quotas

Adjustable quotas

The following quotas apply to the number of forwarding rules that you can add to an ALB instance (excluding the default rule):

Parameter

Description

Default

Maximum value

Adjustable

alb_quota_loadbalancer_rules_num_basic_edition

The maximum number of forwarding rules for a Basic Edition ALB instance, excluding the default rule.

40

100

Yes

alb_quota_loadbalancer_rules_num_standard_edition

The maximum number of forwarding rules for a Standard Edition ALB instance, excluding the default rule.

100

200

Yes

alb_quota_loadbalancer_rules_num_standardwithwaf_edition

The maximum number of forwarding rules for a WAF-enabled Edition ALB instance, excluding the default rule.

100

200

Yes

alb_quota_loadbalancer_rules_num_extensible_edition

The maximum number of forwarding rules for an Extensible Edition ALB instance, excluding the default rule.

100

-

-

alb_quota_fallback_services_num

The number of fallback services supported per forwarding rule (supported only by Extensible Edition instances).

5

-

-

If you approach the forwarding rule limit, consider the following options:

  • Request a quota increase for forwarding rules in Quota Center.

  • Consolidate forwarding rules with similar match conditions. You can use OR logic for multiple values within the same match condition to reduce the number of rules.

  • Upgrade a Basic Edition instance to the Standard edition or WAF-enabled edition for a higher quota.

Hard limits (non-adjustable)

The following hard limits apply to the number of entries per forwarding rule.

Resource

Edition

Default limit

Actions per forwarding rule

Basic Edition

3

Standard edition/WAF-enabled edition

5

Match conditions per forwarding rule

Basic Edition

5

Standard edition/WAF-enabled edition

10

Entries with wildcards per forwarding rule

Basic Edition

5

Standard edition/WAF-enabled edition

10

FAQ

How do I troubleshoot outbound forwarding rules or custom response headers that do not take effect?

Troubleshoot the issue by checking the following items:

  1. Check the outbound match conditions: Verify that the outbound conditions (such as Response Status Code and Response Header) exactly match the response content actually returned by the origin server. If the conditions do not match, the rule is not triggered. As a debugging step, first clear the outbound conditions to verify that the action itself works, and then gradually narrow the condition scope.

  2. Check the interaction between inbound conditions and the rewrite action: If an outbound rule includes attached inbound conditions (such as domain name or path), and the inbound rule for the same request applies a Rewrite action, the inbound conditions in the outbound rule must match the rewritten values, not the original values from the client request. For example, if the inbound rule rewrites the path from /app/page to /v2/page, you must set the path condition in the outbound rule to /v2/page.

  3. Check the configuration sync status: Use ALB access logs or the console to confirm that the rule configuration has been successfully synchronized to the instance. If the rule contains syntax errors or parameter conflicts (for example, a forbidden field such as connection or content-length is written in the outbound direction), the configuration may fail to apply.

  4. Check the rule priority: Confirm that the outbound rule priority is set correctly to avoid being skipped because another rule with a higher priority is matched first.

What should I do if I encounter a VipStatusNotSupport error when deleting a forwarding rule?

This error is usually caused by the ALB instance or listener being in an unstable state. Troubleshoot the issue by checking the following items:

  1. Confirm the ALB instance status: In the instance list in the console, confirm that the instance status is Running. If the instance is in a transitional state such as reconfiguring, creating, or recovering from an exception, wait for the instance to return to the Running state before performing the operation.

  2. Confirm the listener status: Make sure the target listener has been successfully created and is running normally before deleting rules.

  3. Avoid concurrent modifications: Do not perform multiple modification operations on the same listener or its associated rules at the same time, to prevent state conflicts that cause the error.

  4. Check the zone configuration: Confirm that the zone configuration of the ALB instance is consistent with what is displayed in the console.

How do I use the default forwarding rule to block direct access by public IP address or reject requests for domains I do not own?

In addition to using Return Fixed Responses as a catch-all, you can implement the following two common scenarios by configuring the forwarding action of the default forwarding rule:

  • Block direct access by public IP address: Create an empty server group without any backend servers, and change the forwarding action of the default forwarding rule to Forward to this empty server group. When a client accesses the instance directly by public IP address, ALB returns a 503 status code because no backend is available. At the same time, configure separate forwarding rules for your legitimate business domain names that point to the actual server groups.

  • Reject requests for domains you do not own: For domains that resolve to the ALB instance but do not belong to your business (for example, domains that others resolve to it by mistake), configure a forwarding rule with a higher priority than the default rule, set its condition to that domain name, and set its action to Return Fixed Response with a 403 status code.

When you use an empty server group as a catch-all, the TCP connections established between clients and ALB still consume ALB connection resources. To block requests at the connection establishment stage and completely avoid connection resource consumption, we recommend using the listener-level access control (ACL) feature.

References