<div dir="ltr">i <span style="color:rgb(0,0,0);font-family:arial;font-size:medium">am having a problem with trying to use oauth services in that the </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">callback from the provider gets “stuck” on my server. The logs in the </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">pastebin here: <a href="http://pastebin.com/qncJKVwQ">http://pastebin.com/qncJKVwQ</a> summarise the experience. </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">Nginx is setup as reverse proxy to Apache which handles PHP using CGI. that </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">is, the old fashioned CGI and not fastCGI. </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">So the stream of things see to be as follows: </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">1. User makes login request to a PHP file </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">2. Nginx proxies this to Apache </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">3. Apache runs PHP and redirects to oauth provider </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">4. Provider authenticates and returns callback </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">5. Nginx proxies this to Apache </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">6. Apache runs PHP, user is logged in and redirected to index.php </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">7. Nginx proxies this to Apache </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">6. Apache runs PHP and serves index.php </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">On rare successful attempts, there is a big delay in Step 5 and most of the </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">time I just get a 504 Timeout response. </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">Steps 2, 5 & 7 are essentially the same thing but the issues only arises </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">with Step 5 with the callback request. </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">A look at the debug log shows the issue comes in on the callback call </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">between the "event timer add" & "post event” steps. </span><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><br style="clear:both;color:rgb(0,0,0);font-family:arial;font-size:medium"><span style="color:rgb(0,0,0);font-family:arial;font-size:medium">Will appreciate any insights.</span></div>