Example 1: Delete Old X-Forwarded-For and Client-IP Headers 编辑

September 21, 2020 Contributed by:  S

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.


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.

NameTypeArgument(s)
act_del_xfordelete_http_headerx-forwarded-for
act_del_cipdelete_http_headerclient-ip

In the Create Rewrite Policy dialog box, create two rewrite policies with the following descriptions.

NameExpressionAction
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.

NamePriorityGoto Expression
pol_check_xfor100200
pol_check_cip200300

All old X-Forwarded-For and Client-IP HTTP headers are now deleted from incoming requests.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:53 次

字数:4267

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文