Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

leo.denham@gmail.com's avatar

502 Bad Gateway sending mail via SES on Nginx but not PHP web server

Hiya

Recently during local testing ( Laravel 5.3 / OSX Sierra / PHP 7.1.3 / Nginx 1.10.3 ), whenever an event is fired sending an email via Amazon SES I get a 502 Bad Gateway. Logs show *1 upstream prematurely closed connection while reading response header from upstream,'

When I use the php dev server via artisan:serve all works fine. If I change the mail service to smtp, it also works using nginx too. I'm really struggling how to debug this, can anyone give me a steer? The code for sending mails has been unchanged for ages.

Thanks

Leo

0 likes
0 replies

Please or to participate in this conversation.