我正在尝试在 Nginx 服务器上使用来自 Laravel 的 GuzzleHttp 向 restful API 发送 POST 请求,但我有一个 502 错误网关。
$from_date = Carbon::today()->format('Y-m-d');
$to_date = Carbon::today()->format('Y-m-d');
$domain = "abc.vn";
$key = "keyacbxyz";
$client = new Client();
$response = $client->post('http://exampleurl.com', [
'json' => [
'fromdate' => $from_date,
'todate' => $to_date,
'domain' => $domain,
'key' => $key
]
]);
但是当我在 Windows XAMPP 上从本地运行 Laravel 时效果很好。此外,我的本地 URL 是http://127.0.0.1:8000/。那么有人可以向我解释问题是什么吗?