aws 上的 reCaptcha 和负载均衡器
reCaptcha and loadbalancer on aws
您好,我的应用程序正在使用来自 google 的 recaptcha,当仅通过 nginx 提供服务时,它工作正常。现在我们已经设置了一切以在 aws 上的负载均衡器后面工作,它给出了无效的响应并且用户无法注册。
任何人有任何建议为什么会发生这种情况?
您必须启用代理协议设置以获取客户端的 IP 和粘性会话,以便应用程序知道该会话已经过验证并且它 returns 到同一应用程序服务器。
Proxy Protocol is an Internet protocol used to carry connection information from the source requesting the connection to the destination for which the connection was requested. Elastic Load Balancing uses Proxy Protocol version 1, which uses a human-readable header format.
By default, when you use Transmission Control Protocol (TCP) for both front-end and back-end connections, your Classic Load Balancer forwards requests to the instances without modifying the request headers. If you enable Proxy Protocol, a human-readable header is added to the request header with connection information such as the source IP address, destination IP address, and port numbers. The header is then sent to the instance as part of the request.
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html
您好,我的应用程序正在使用来自 google 的 recaptcha,当仅通过 nginx 提供服务时,它工作正常。现在我们已经设置了一切以在 aws 上的负载均衡器后面工作,它给出了无效的响应并且用户无法注册。
任何人有任何建议为什么会发生这种情况?
您必须启用代理协议设置以获取客户端的 IP 和粘性会话,以便应用程序知道该会话已经过验证并且它 returns 到同一应用程序服务器。
Proxy Protocol is an Internet protocol used to carry connection information from the source requesting the connection to the destination for which the connection was requested. Elastic Load Balancing uses Proxy Protocol version 1, which uses a human-readable header format.
By default, when you use Transmission Control Protocol (TCP) for both front-end and back-end connections, your Classic Load Balancer forwards requests to the instances without modifying the request headers. If you enable Proxy Protocol, a human-readable header is added to the request header with connection information such as the source IP address, destination IP address, and port numbers. The header is then sent to the instance as part of the request.
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html