我在本地机器和Drupal项目中使用Openshift Demo,当我在form.php中提交时,我需要使用带有curl lib的REST API创建一个应用程序,然后我得到:
Proxy Error 502
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /.
Reason: Error reading from remote server
我的所有日志文件中都没有任何可疑的东西,我也改变了haproxy配置,httpd.conf,broker.conf中的所有参数(TimeOut,size ..),我仍然有错误所以任何想法为什么会出现这个错误?
这是我的卷曲代码:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, null);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'name=test&cartridge[url]=my_Cartridge_URL');
curl_setopt($ch, CURLOPT_POST, true);
$server_output_app_create = curl_exec ($ch);
drupal_set_message(''. print_r($server_output_app_create, TRUE) .'');
curl_close ($ch);
由于