504 Gateway Time-out when calling curl_exec() in PHP with SSL peer verification (CURLOPT_SSL_VERIFYPEER) off

Lukas Tribus luky-37 at hotmail.com
Mon Aug 26 15:25:51 UTC 2013


Hi!


> If this were the root cause, wouldn't the cURL call fail in the way way,
> regardless of the CURLOPT_SSL_VERIFYPEER value? In other words, it
> doesn't seem like changing this cURL option would change the number of
> backend processes required to handle the request(s). But I could be wrong.

Yes, it there is a difference. CURLOPT_SSL_VERIFYPEER = true probably masks
your real problem, because it fails at SSL level (due to certificate
validation failure; after all, thats why you disabled it, right?).

So the HTTP request passes only when you disable certificate validation,
which is way you see the 504 error only when its disabled. That doesn't
mean there is a problem with curl or SSL. It means there is a problem
with your backend.



> Any further troubleshooting tips would be much appreciated.

Triple check that your backend can handle multiple requests simultanously
and that your script doesn't somehow create a deadlook (requesting the
output of itself).

Check FCGI logs. If that doesn't help, increment the debug levels on nginx
and FCGI.




Regards,

Lukas 		 	   		  


More information about the nginx mailing list