If you are using caddy and you have a FCGI handler running on a port (that even automatically restarts after close), you probably will be confrontend with 502 errors when one FCGI stops and the next restarts.
On windows, FCGI default closes after 500 requests, which you can increase but it does not properly solve the issue, it just delays it.
In caddy, you can load balance between the same upstreams to easily wait for the next upstream to restart.
This config balances between same upstreams and gracefully retry a few times (each 250ms for 5s) to serve the request.
Caddy config: