Bad Gateway error after 2642 request

I have a PHP web page which load a lot of files (1412 request are to be processed)
If I load the page for the first time there are no problems. Reloading the page cause the error 502 for the last 182 requests.

I used php-cgi for processing the php files.

If I use php-fpm all seem to work well.

If I start php-cgi as “server” : php-cgi -S 127.0.0.1:8080 -t.
there is no limitation while reloading the “big page”.

I think that there is probably a bug within caddy.

Hi @jjsa, welcome to the Caddy community.

What’s your Caddyfile?

I had some version of the Caddyfile wich all worked well.
The problem is within php-cgi. I fixed this with setting and exporting PHP_FCGI_MAX_REQUESTS=0 before of lauching php-cgi.
I Work under Linux and use at this time caddy 1.0.3

1 Like