oauth2_proxy icon indicating copy to clipboard operation
oauth2_proxy copied to clipboard

Gateway Timeout with AWS ALB

Open sprice-janrain opened this issue 7 years ago • 4 comments

oauth2_proxy version: 2.2 OS: Ubuntu 16.04 authentication: Google G Suite non-default cookie settings: cookie-refresh=1h

I'm running oauth2_proxy in front of some sensitive services that I want to lock down to specific Google groups. The hosts are behind an AWS Application Load Balancer configured to contact the host directly on port 4180 (http). It works fine sometimes, but often what happens is that I get a 504 Gateway Timeout after waiting a minute.

I've sometimes been able to get past this by opening the url in a private browser session, or by clearing cookies specific to that site. Sometimes it will start responding after 3 tries, sometimes never.

Is there anything further I can do to troubleshoot this issue?

sprice-janrain avatar Apr 20 '18 16:04 sprice-janrain

Hi, @sprice-janrain, have you found out solution to the issue? I think I've encountered the same. If I send requests to oauth2_proxy directly, everything is ok, however, behind ALB sometimes requests time out.

jakubkulhan avatar Oct 25 '18 07:10 jakubkulhan

@jakubkulhan I solved the issue by increase ALB timeout value. Hope it helps. https://www.terraform.io/docs/providers/aws/r/lb.html#idle_timeout

andycui66 avatar Nov 15 '18 20:11 andycui66

@andycui66 does that mean it takes 1m plus to connect? I found in my case only 1 of the LBs of my ALB ips was failing, the other one works. (tested using curl loops)

pecigonzalo avatar Jan 15 '19 11:01 pecigonzalo

@pecigonzalo in my case, yes. It sometimes take more than 1 min for server to response.

andycui66 avatar Jan 15 '19 14:01 andycui66