johndoee's avatar

Remote server at mydomain.com returned an HTTP 502 when send test in coinbase commerce webhook

i run my laravel app with nginx server on AWS EC2. i make handleWebhook function with post method to receive coinbasecommerce webhook event . this post method is API endpoint url in api.php

Route::post('/webhook/coinbase',[App\Http\Controllers\HomeController::class,'handleWebhook'])->name('charge.webhook');

i set this route as endpoint url in coinbasecommerce notification page.

https://mydomain/api/webhook/coinbase

i also make nginx conf block for proxy pass url for this route

location /api/webhook/coinbase {
  proxy_pass http://localhost:8000;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto https;
  proxy_read_timeout 90;
}

and i make send test by coinbasecommerce.

i get Http 502 error.

what wrong? can someone help me.

0 likes
6 replies
Snapey's avatar

errors in your laravel log file?

Snapey's avatar

why do you need the proxy setup for a webhook?

johndoee's avatar

@Snapey i use nginx with laravel on EC2 instance . no error in log file , in nginx log file

2023/02/24 10:26:46 [alert] 133103#133103: 768 worker_connections are not enough
2023/02/24 10:26:46 [error] 133103#133103: *1557 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client:myipaddress, server: mydomain.org, request: "POST /webhook/coinbase HTTP/1.0", upstream: "https://myipaddress/webhook/coinbase", host: "mydomain.org"
johndoee's avatar

@shaungbhone yes , laravel app run on nginx server with EC2 .i try to call is API endpoint URL by coinbasecommerce . this API endpoint url cannot access .

Please or to participate in this conversation.