I’m running a PHP 8.1 Laravel application on an Apache server. The same server also runs a Node.js API (separate subdomain). The site is behind Cloudflare.
The issue:
The site randomly goes down for 10–20 minutes, then comes back without me doing anything.
During downtime, the Laravel site is inaccessible and Node.js APIs return Cloudflare 522 (connection timeout).
Sometimes the APIs still work when tested directly with Postman, but the Laravel frontend is down.
I’ve confirmed this with Uptime Robot monitoring, which shows repeated outages.
Laravel logs during downtime:
[2025-09-01 04:27:35] production.ERROR: Product Detail Error: cURL
error 56: Recv failure: Connection reset by peer for
http://ip-api.com/json/52.167.144.238[2025-09-01 04:28:39] production.ERROR: API Request Error: Server
error: POST https://node.byyu.com/api/oneapiseconds resulted in a 522
response: error code: 522Apache (cPanel) error logs show: [Mon Sep 01 02:19:50.127766 2025]
[authz_core:error] [client 52.71.218.25:19567] AH01630: client denied
by server configuration: /home/byyu/public_html/app/Http/error_log[Sun Aug 31 22:23:46.573272 2025] [autoindex:error] [client
87.58.67.112:63776] AH01276: Cannot serve directory /home/byyu/public_html/admin/images/: No matching DirectoryIndex
found, and server-generated directory index forbidden
What I’ve observed:
Short outages (~5 min) sometimes produce no Laravel logs.
Longer outages (~10–20 min) always produce the above errors.
The website recovers automatically after some minutes, without restarting services.
My questions:
What could cause Laravel + Apache + Node.js to become unreachable for 10–20 minutes and then recover automatically?
Are the cURL error 56 and Cloudflare 522 hints of a resource bottleneck (CPU/memory), or a configuration issue with Apache/PHP-FPM?
What’s the best way to diagnose this kind of intermittent downtime on a shared server (cPanel)?
Any advice on debugging steps, or configuration changes I should check (Apache KeepAlive, PHP-FPM workers, Node process manager, etc.), would be appreciated.
Environment:
PHP 8.1, Laravel, Apache (cPanel hosting) Node.js backend on same server (node.byyu.com) Cloudflare in front of both domains
I tried changing the apis mentioned above which are node apis and optimized the api queries. Also i break out the api on dashboard again a node api the dashboard api was previously gaetting all data in sigle api i break down that api in one and two part first bings only banners, categories data and other brings the products.