我究竟应该在haproxy.cfg

时间:2016-01-02 22:59:21

标签: php openshift haproxy

我的php应用程序工作正常,但有时我得到

  

504网关超时服务器没有及时响应。

即使我重新启动应用程序,我也无法摆脱这个问题。

haproxy日志:

  [WARNING] 001/175903 (47931) : Server express/local-gear is DOWN, reason: Layer4 timeout, check duration: 2000ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 001/175903 (47931) : proxy 'express' has no server available!
[WARNING] 001/175933 (47931) : Server express/local-gear is UP, reason: Layer7 check passed, code: 302, info: "HTTP status check returned code <3C>302<3E>", check duration: 9ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 001/180043 (47931) : Server express/local-gear is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 001/180043 (47931) : proxy 'express' has no server available!
[WARNING] 001/180113 (47931) : Server express/local-gear is UP, reason: Layer7 check passed, code: 302, info: "HTTP status check returned code <3C>302<3E>", check duration: 19ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

我在互联网上找到的解决方案是在haproxy.cfg option httpchk GET中进行更改,但不知道我应该做什么。

我的应用程序位于@ /app-root/repo/php文件夹,我有index.php,我也有api文件夹来访问我的app api。

1 个答案:

答案 0 :(得分:0)

如果您想要修改haproxy.cfg,可以通过rhc ssh <yourApp>然后编辑~/haproxy/conf/haproxy.cfg文件来搜索您的应用。但请注意,不支持自定义haproxy配置,因此我建议在进行任何更改之前备份该文件,以防您需要恢复默认配置。

进行任何配置更改后,请rhc app-restart <yourApp>重新启动应用。