On the navigation pane, under Load Balancing, choose Load Balancers.
Select your load balancer.
Choose the Listeners tab.
Select your listener, and then from the Actions dropdown, choose View listener details.
Under Rules, choose Manage rules.
Choose the Add rules icon (the plus sign), and then choose Insert rule.
Choose Add condition, and then choose Http header.
Specify a header name based on the desired action. For example, "Accept." Note: The maximum size of each header name is 40 characters. The header name isn't case sensitive. Wildcards aren't supported.
Specify the values (comparison strings) of the custom header. Note: The maximum size of each comparison string is 128 characters. The comparison string isn't not case sensitive. The asterisk (*) and question mark (?) wildcard characters are supported.
Choose Add action, and then select the required action. For example: Forward – To forward to a different target group. Redirect to - To redirect to a different URL. Return fixed response – To block or provide a custom response to particular clients based on the value of custom header.