Report this

What is the reason for this report?

502 Gateway Error on nginx Running a Laravel App

Posted on October 23, 2015

I’m reaching out to see if anyone out there might be able to offer a little insight into an odd issue one of my sites is encountering.

I set up a Laravel project on a Droplet (1GB Ram 30GB SSD Disk New York 3 Ubuntu 14.04 x64). The Droplet is running several sites under a few subdomains.

At 6 PM EST two days ago we started throwing 502 bad gateway response on one of the Laravel sites. All the other subdomains on that Droplet appeared to be working as expected.

I created a new Droplet and moved the offending Laravel project to it. It’s 2GB Ram 40GB SSD Disk same OS. At 7 PM EST yesterday we started throwing 502 bad gateway again on the new Droplet.

In both cases running “service php5-fpm restart” seemed to resolve the issue. Network traffic and CPU consumption were relatively low and dropped off when we started throwing errors, Memory consumption jumped slightly.

I’m reaching out to you to see if anyone has experienced anything similar and if there is a solution out there.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

It sounds like that your PHP-FPM service is crashing. This is most likely due to out of memory.

I would recommend adjusting your PHP memory limit so that it is not too high and maybe also adding some more RAM.

You could also check your access logs and make sure that there’s no malicious activity going on.

Finally what you could do is optimize your site so that it uses fewer resources.

Regards, Bobby

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.