Example 1: Delete Old X-Forwarded-For and Client-IP Headers 编辑
Example 1: Delete Old X-Forwarded-For and Client-IP Headers
Example Inc. wants to remove old X-Forwarded-For and Client-IP HTTP headers from incoming requests, so that the only X-Forwarded-For headers that appear are the ones added by the local server. This configuration can be done through the Citrix ADC command line or the configuration utility. The Example Inc. system administrator is an old-school networking engineer and prefers to use a CLI where possible, but wants to be sure he understands the configuration utility interface so that he can show new system administrators on the team how to use it.
The examples below demonstrate how to perform each configuration with both the CLI and the configuration utility. The procedures are abbreviated on the assumption that users will already know the basics of creating rewrite actions, creating rewrite policies, and binding policies.
- For more detailed information about creating rewrite actions, see Configuring a Rewrite Action
. - For more detailed information about creating rewrite policies, see Configuring a Rewrite Policy
. - For more detailed information about binding rewrite policies, see Binding a Rewrite Policy
.
To delete old X-Forwarded and Client-IP headers from a request by using the command line interface
At the command prompt, type the following commands in the order shown:
add rewrite action act_del_xfor delete_http_header x-forwarded-foradd rewrite action act_del_cip delete_http_header client-ipadd rewrite policy pol_check_xfor 'HTTP.REQ.HEADER("x-forwarded-for").EXISTS' act_del_xforadd rewrite policy pol_check_cip 'HTTP.REQ.HEADER("client-ip").EXISTS' act_del_cipbind rewrite global pol_check_xfor 100 200bind rewrite global pol_check_cip 200 300<!--NeedCopy-->
To delete old X-Forwarded and Client-IP headers from a request by using the configuration utility
In the Create Rewrite Action dialog box, create two rewrite actions with the following descriptions.
Name | Type | Argument(s) |
---|---|---|
act_del_xfor | delete_http_header | x-forwarded-for |
act_del_cip | delete_http_header | client-ip |
In the Create Rewrite Policy dialog box, create two rewrite policies with the following descriptions.
Name | Expression | Action |
---|---|---|
pol_check_xfor | ‘HTTP.REQ.HEADER(“x-forwarded-for”).EXISTS’ | act_del_xfor |
pol_check_cip | ‘HTTP.REQ.HEADER(“client-ip”).EXISTS’ | act_del_cip |
Bind both policies to global, assigning the priorities and goto expression values shown below.
Name | Priority | Goto Expression |
---|---|---|
pol_check_xfor | 100 | 200 |
pol_check_cip | 200 | 300 |
All old X-Forwarded-For and Client-IP HTTP headers are now deleted from incoming requests.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论