我用Laravel。 这是代码
$client = new \GuzzleHttp\Client();
$request = $client->post($urls['payment_generate'], [
'form_params' => [
'ClientID' => 'client_id',
'Username' => 'username',
'Password' => 'some-password',
'Description' => 'Order description',
'Amount' => 500,
'OrderID' => 8349689468,
'BackURL' => 'back url'
]
]);
我有两个具有相同参数的ubuntu服务器。 一台服务器工作正常。但是其他的它不发送发布请求,最后我得到这个错误
504网关超时nginx / 1.15.6
我丢了两个$ clinets,结果出现了。这是一台正在工作的服务器
Client {#342 ▼
-config: array:7 [▼
"handler" => HandlerStack {#340 ▶}
"allow_redirects" => array:5 [▶]
"http_errors" => true
"decode_content" => true
"verify" => true
"cookies" => false
"headers" => array:1 [▼
"User-Agent" => "GuzzleHttp/6.3.3 curl/7.58.0 PHP/7.1.20-1+ubuntu18.04.1+deb.sury.org+1"
]
]
}
此服务器无法正常工作
Client {#270 ▼
-config: array:7 [▼
"handler" => HandlerStack {#322 ▶}
"allow_redirects" => array:5 [▶]
"http_errors" => true
"decode_content" => true
"verify" => true
"cookies" => false
"headers" => array:1 [▼
"User-Agent" => "GuzzleHttp/6.3.3 curl/7.58.0 PHP/7.1.28-1+ubuntu18.04.1+deb.sury.org+3"
]
]
}
所有配置都是相同的,只是不同的 User-Agent
我该如何解决?