This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
如何使用响应程序将 HTTP 请求重定向到 HTTPS
本文介绍如何使用负载平衡虚拟服务器 IP 地址配置响应程序功能,并将客户端请求从 HTTP 重定向到 HTTPS。
考虑一种情况,其中用户可能会尝试通过发送 HTTP 请求访问安全网站。您可能希望将请求重定向到安全网站,而不是删除请求。您可以使用响应程序功能将请求重定向到安全网站,而无需更改用户尝试访问的路径和 URL 查询。
Citrix ADC 响应程序如何将请求从 HTTP 重定向到 HTTPS
下图显示了设备如何重定向请求的逐步流程。
注意:导航路径和屏幕快照来自 NetScaler 11.0。
要配置响应程序功能以及 NetScaler 设备的负载平衡 VIP 地址以将客户端请求从 HTTP 重定向到 HTTPS,请完成以下过程。
-
在设备上启用响应程序功能。导航到系统 > 设置 > 配置高级功能 > 响应程序。
- 创建响应程序操作并在“名称”字段中指定适当的名称,如 http_to_https_actn。
- 要创建响应程序操作,请在导航窗格中展开 AppExpert > 响应程序,单击操作,然后单击添加。
- 选择重定向为类型。
-
在“表达式”字段中,键入以下表达式:
"https://" + HTTP.REQ.HOSTNAME.HTTP_URL_SAFE + HTTP.REQ.URL.PATH_AND_QUERY.HTTP_URL_SAFE
。 -
在 NetScaler 版本 9.0 和 10.0 中,确保清除旁路安全检查选项。
注意:从 NetScaler 11.0 开始,此选项不存在。
- 创建响应程序策略 并在“名称”字段中指定适当的名称,如 http_to_https_pol。
- 要创建响应程序策略,请在导航窗格中展开 AppExpert > 响应程序,单击策略,然后单击添加。
- 从“操作”列表中,选择您创建的操作名称。
- 从“未定义的操作”列表中,选择“RESET”。
- 在表达式字段中键入 HTTP.REQ.IS_VALUE 表达式,如下面的屏幕截图所示。
- 创建状态始终标记为 UP 的监视器,并在“名称”字段中指定适当的名称,例如 localhost_ping。
- 若要创建监视器,请在导航窗格中展开负载平衡,单击监视器,然后单击添加。
-
在“目标 IP”字段中,指定 127.0.0.1 IP 地址,如以下屏幕截图所示。
- 创建服务并在“名称”字段中指定适当的名称,例如 Always_UP_service。
- 若要创建服务,请在导航窗格中展开负载平衡,单击服务,然后单击添加。
-
在“服务器”字段中指定不存在的 IP 地址。
- 在端口字段中指定 80。
- 从“可用监视器”列表中添加已创建的监视器。
- 创建负载平衡虚拟服务器并在名称字段中指定适当的名称。
- 若要创建负载平衡虚拟服务器,请在导航窗格中展开负载平衡,单击服务,然后单击添加。
- 在“IP 地址”字段中指定网站的 IP 地址。
- 从协议列表中选择 HTTP。
- 在端口字段中键入 80。
-
在 NetScaler 版本 9.0 和 10.0 上,选择您在“服务”选项卡中创建的服务的“活动”选项,如下面的屏幕截图所示。在 NetScaler 版本 11.0 中,此选项已弃用。
- 单击策略选项卡。
- 将您创建的响应程序策略绑定到网站的 HTTP 负载平衡 VIP 地址。
- 创建具有网站和端口 IP 地址为 443 的安全负载平衡虚拟服务器。
要从设备的命令行界面创建与上述过程类似的配置,请运行以下命令:
enable ns feature responder
add responder action http_to_https_actn redirect ""https://" + http.req.hostname.HTTP_URL_SAFE + http.REQ.URL.PATH_AND_QUERY.HTTP_URL_SAFE"
add responder policy http_to_https_pol HTTP.REQ.IS_VALID http_to_https_actn RESET
add lb monitor localhost_ping PING -LRTM ENABLED -destIP 127.0.0.1
add service Always_UP_service 1.2.3.4 HTTP 80 -gslb NONE -maxClient 0 -maxReq 0 -cip ENABLED dummy -usip NO -sp OFF -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB NO -CMP YES
bind lb monitor localhost_ping Always_UP_service
add lb vserver http_site.com HTTP 10.217.96.238 80 -persistenceType COOKIEINSERT -timeout 0 -cltTimeout 180
bind lb vserver http_site.com Always_UP_service
bind lb vserver http_site.com -policyName http_to_https_pol -priority 1 -gotoPriorityExpression END
<!--NeedCopy-->
注意:
- 端口 80 负载平衡重定向虚拟服务器的状态必须为 UP 才能重定向工作。
- 如果 HTTPS 虚拟服务器未处于活动状态,Web 浏览器可能无法正确重定向。
- 此重定向设置允许多个域绑定到同一 IP 地址的情况。
- 如果客户端向重定向虚拟服务器发送无效的 HTTP 请求,则设备会发送 RESET 消息代码。
共享
共享
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.