When I send the Curl request from local PHP script to the local server via SSL (running nginx 1.9.4 on Windows via WPN-XM) then the browser is "waiting" until it gets the 504 error. The PHP-fpm is probably dead, because the web server does not proccess any other request.
When I send the same request to the production server it works correctly.
When I send the Curl request from command line, then it works.
When I open the final resource in web browser then it works.
I have spent 4 hours googling and reading Stac Owerflow, but did not find any other situation like I have.
Thanks!
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://webserver.local/resource");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // just on local
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // just on local
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
$response = curl_exec($ch);