php - 连接 Facebook Graph API 时 ElasticBeanstalk for PHP 上的 504 网关超时

标签 php facebook facebook-graph-api amazon-web-services amazon-elastic-beanstalk

当用户使用他们的 Facebook 登录名连接到我的网络应用程序时,服务器不会重定向回来,因为它在途中捕获了 504 错误。

它在我的本地测试环境中正常工作,但在我使用 Amazon Elastic Beanstalk 作为平台的暂存服务器上出现问题。

知道如何解决这个问题吗?

最佳答案

来自 http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ts-elb-error-message.html

Description: Indicates that the load balancer closed a connection because a request did not complete within the idle timeout period.

Cause 1: The application takes longer to respond than the configured idle timeout.

Solution 1: Monitor the HTTPCode_ELB_5XX and Latency CloudWatch metrics. If there is an increase in these metrics, it could be due to the application not responding within the idle timeout period. For details about the requests that are timing out, enable access logs on the load balancer and review the 504 response codes in the logs that are generated by Elastic Load Balancing. If necessary, you can increase your back-end capacity or increase the configured idle timeout so that lengthy operations (such as uploading a large file) can complete.

Cause 2: Registered instances closing the connection to Elastic Load Balancing.

Solution 2: Enable keep-alive settings on your EC2 instances and set the keep-alive timeout to greater than or equal to the idle timeout settings of your load balancer.

关于php - 连接 Facebook Graph API 时 ElasticBeanstalk for PHP 上的 504 网关超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24547861/

相关文章:

php - 如何使 PHP 网站同时支持 HTTP 和 HTTPS?

php - Javascript Span 作为 PHP 变量

Facebook Graph API 帖子不会向页面用户显示,仅向管理员显示

javascript - 如何通过javascript SDK在facebook上上传照片

node.js https.get() 触发错误 ECONNREFUSED

php - 如何去除表头<the>缝隙

php - lotto.php(我正在努力将随机数放入 "ticket")

swift - ios swift 2 代表该页面在 facebook 页面上发帖

facebook - 当 Facebook 停止支持 rss feed 时,如何从 Facebook 检索 feed?

php - 如何从 Facebook Graph API 获取所有 friend 的提要