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

dipherent's avatar

502 & 504 Bad Gateway - Suddenly

Hi friends,

My website (Laravel 8) has been running for months with no problems. Today users get 502 adn sometimes 504 bad gateway..nginx

I am on Forge and was able to check some logs, for example:

php log:

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

I increased it and nothing worked. I get:

 WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 48 idle, and 187 total children

can you please help?

Many thanks

0 likes
6 replies
dipherent's avatar

@jlrdw Thank you for your kind support. I started to suspect this is a DDoS.

I found that link you sent earlier and played with all the settings it mentioned and nothing changed. 2 hours passed and the site was back by itself. I checked my Linode and my CPU usage during those two hours was 380% which is not normal as this is the first time it reaches this level.

I tried to go to the server log and see the activity for that period and couldn't find much. However, the firewall log ufw.log showed that it blocked a lot of attempts from a certain IP (I found more than 6000 lines for that IP)

Do you think this IP is the cause? if so, isn't it already blocked by the firewall and it shouldn't cause any problems?

How else can I know if this was a DDoS attack? I know it will happen again so if I am a target.

I truly appreciate your help and knowledge,

Thanks

dipherent's avatar

@jlrdw thank you so much for your kind support. I am on it now and will learn more about all possible options I have.

dipherent's avatar

@jlrdw Just to update you on this in case you were wondering:

Apparently this was caused by some error in my php configuration (PHP FPM Config). Of course I never touched that prior to the error and I tried to talk to the service providers I use (without mentioning names) and all I got is that it is not their fault and they did not change any settings ...etc

Long story short, If this happens to anyone, make sure the settings in your PHP config files are OK.. As for the DDoS attacks, I have been reading about CloudFlare and It is something to really consider if you are under such threats.

Thanks again for your help.

Please or to participate in this conversation.