简体   繁体   English

AWS上的reCaptcha和Loadbalancer

[英]reCaptcha and loadbalancer on aws

Hello my application is using recaptcha from google, and when served only over nginx it works fine. 您好我的应用程序使用的是来自Google的recaptcha,并且仅通过nginx提供服务时,它可以正常工作。 Now we've setup everything to work behind load balancer on aws and it gives invalid response and users can't register. 现在,我们已将所有内容设置为可在aws上的负载均衡器后面运行,并且给出的响应无效且用户无法注册。

Anyone has suggestions why is this happening? 任何人都有建议为什么会这样?

You have to enable the Proxy Protocol setting to get the client's IP and sticky sessions so that application knows that session has been validated and it returns to the same app server. 您必须启用“代理协议”设置来获取客户端的IP和粘性会话,以便应用程序知道该会话已通过验证,并返回到同一应用程序服务器。

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. 代理协议是一种Internet协议,用于将连接信息从请求连接的源传送到请求连接的目的地。 Elastic Load Balancing uses Proxy Protocol version 1, which uses a human-readable header format. Elastic Load Balancing使用代理协议版本1,该版本使用人类可读的标头格式。

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. 默认情况下,当您同时对前端和后端连接使用传输控制协议(TCP)时,Classic Load Balancer会将请求转发到实例,而无需修改请求标头。 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. 如果启用代理协议,则将人类可读的标头添加到请求标头中,并附带连接信息,例如源IP地址,目标IP地址和端口号。 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/enable-proxy-protocol.html

http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM