2.8. L7 HTTP Policies¶
To enable advanced ADC functionality this iApp template includes the ability to fully create and manipulate LTM Local Traffic Policies. The policies allow various routing and manipulation operations of HTTP/HTTPS requests. In this lab we will cover some common use cases for Local Traffic Policies.
2.8.1. HTTP URI/Host Based Routing
In this lab we will create a deployment that implements routing based on the HTTP URI or Host Header to one of four pools:
- HTTP Host equals www.example1.com
- HTTP URI starts with /pool0/ -> Pool 0
- HTTP URI starts with /pool1/ -> Pool 1
- HTTP Host equals www.example2.com
- HTTP URI starts with /pool2/ -> Pool 2
- HTTP URI starts with /pool3/ -> Pool 3
Create a new deployment with the following values:
Field Name Value Name Lab2.8 Template appsvcs_integration_v2.0.003 Virtual Server: Address 10.1.20.18 `Virtual Server: Port <AppSvcsiAp p_presoref.html# preso-pool-port> `__ 80 Pool: Pool Table - Row 1:
- Index: 0
- Monitor(s): 0
- Row 2:
- Index: 1
- Monitor(s): 0
- Row 3:
- Index: 2
- Monitor(s): 0
- Row 4:
- Index: 3
- Monitor(s): 0
Pool: Members - Row 1:
- Pool Idx: 0
- IP/Node Name: 10.1.10.100
- Port: 80
- Row 2:
- Pool Idx: 1
- IP/Node Name: 10.1.10.101
- Port: 80
- Row 3:
- Pool Idx: 2
- IP/Node Name: 10.1.10.102
- Port: 80
- Row 4:
- Pool Idx: 3
- IP/Node Name: 10.1.10.103
- Port: 80
Monitor: Monitor Table - Row 1:
- Index: 0
- Name: /Common/http
Virtual Server: Client-side L4 Protocol Profile /Common/tcp-wan-optimized Virtual Server: Server-side L4 Protocol Profile /Common/tcp-lan-optimized Virtual Server: HTTP Profile /Common/http L7 Policy: Rules: Matching _ - Row 1:
- Group: 0
- Operand: http-host/request/host
- Condition: equals
- Value: www.example1.com
- Row 2:
- Group: 0
- Operand: http-uri/request/path
- Condition: starts-with
- Value: /pool0/
- Row 3:
- Group: 1
- Operand: http-host/request/host
- Condition: equals
- Value: www.example1.com
- Row 4:
- Group: 1
- Operand: http-uri/request/path
- Condition: starts-with
- Value: /pool1/
- Row 5:
- Group: 2
- Operand: http-host/request/host
- Condition: equals
- Value: www.example2.com
- Row 6:
- Group: 2
- Operand: http-uri/request/path
- Condition: starts-with
- Value: /pool2/
- Row 7:
- Group: 3
- Operand: http-host/request/host
- Condition: equals
- Value: www.example2.com
- Row 8:
- Group: 3
- Operand: http-uri/request/path
- Condition: starts-with
- Value: /pool3/
L7 Policy: Rules: Action - Row 1:
- Group: 0
- Target: forward/request/select/pool
- Parameter: pool:0
- Row 2:
- Group: 1
- Target: forward/request/select/pool
- Parameter: pool:1
- Row 3:
- Group: 2
- Target: forward/request/select/pool
- Parameter: pool:2
- Row 4:
- Group: 3
- Target: forward/request/select/pool
- Parameter: pool:3
- Row 1:
Review the deployed policy by clicking on the Lab2.8_l7policy object in the component view.
- Review the rules that were created by the iApp template
2.8.2. HTTP Cookie/Header Manipulation
We will now modify the existing deployment to perform some Header and Cookie manipulations.
Click iApps -> Application Services -> Lab2.8 -> Reconfigure
Modify the following values and click ‘Finished’:
Field Name Value L7 Policy: Rules: Action - Row 5:
- Group: 0
- Target: http-header/request/insert/name,value
- Parameter: X-My-Header,Lab2.8
- Row 6:
- Group: 1
- Target: http-cookie/request/insert/name,value
- Parameter: MyCookie,Lab2.8
- Row 7:
- Group: 2
- Target: http-header/request/remove/name
- Parameter: User-Agent
- Row 8:
- Group: 3
- Target: http-header/response/replace/name,value
- Parameter: Server,GoAway
- Row 5:
Review the deployed policy by clicking on the Lab2.8_l7policy object in the component view.
- Review the updated actions in the existing rules.
2.8.3. HTTP Redirects
Finally, we will modify the existing deployment to issue an HTTP redirect for any traffic that does not specfically match the rules we created in the first step of this lab.
Click iApps -> Application Services -> Lab2.8 -> Reconfigure
Modify the following values and click ‘Finished’:
Field Name Value L7 Policy: Rules: Matching _ - Row 9:
- Group: default
L7 Policy: Rules: Action - Row 9:
- Group: default
- Target: http-reply/request/redirect/location
- Parameter: http://www.example3.com
- Row 9:
Review the deployed policy by clicking on the Lab2.8_l7policy object in the component view.
- Review the updated rules in the policy.
The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.