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

Szyfr's avatar
Level 3

Please Help, I'm currently running my website on production

Please Help, I'm currently running my gaming website on production, I'm getting flooded in chrome dev tools, with error 502 bad gateway, how to fix this? Thanks!

using digital ocean and laravel forge

0 likes
10 replies
frezno's avatar

it's a server problem. tell your provider about it. maybe apache (ngix) has to be restarted.

Szyfr's avatar
Level 3

@frezno

ok I manage to fix the problem,

What i did is, I modify nginix.conf and /etc/php-fpm.d/www.con

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

and

listen = /var/run/php7.0-fpm.sock

to

listen = 127.0.0.1:9000

now I'm not getting flooded bad gateway, but my problem now is my site is so slow, running 16 cpu. 48gb memory and 8tb transfer, only 100 concurrent users, i dunno what to do now >_<

luceos's avatar

Did you configure your pool correctly to allow for sufficient connections?

Szyfr's avatar
Level 3

@luceos I dunno how to configure pool sir, I've just follow server management tutorial then

I've just modify nginix.conf

worker_connections 1024;

then added this settings on forge nginix.conf

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
martinbean's avatar

@Encrypt I think you really need to look at your application and improve it if that’s the type of hardware you need to serve only 100 users.

ejdelmonico's avatar

Scan the server logs for issues. Also, try New Relic to identify possible causes.

Szyfr's avatar
Level 3

@ejdelmonico

before, my logs getting flooded

unix:/var/run/php/php7.0-fpm.sock failed Connection reset

then I modify

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

and

listen = /var/run/php7.0-fpm.sock

to

listen = 127.0.0.1:9000

now I'm getting

connect() failed (111: Connection refused) while connecting to $ upstream

but not getting flooded bad gateway.

Okay sir I'll check New Relic.

ejdelmonico's avatar

I would scan for malware as well. If you are sure all is good, then maybe consider CloudFlare to help with the issue for now.

1 like

Please or to participate in this conversation.