From 1e57a7c90c041b5dbec32c90b044da200cf39aec Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Wed, 17 Jun 2026 14:30:40 +0000 Subject: [PATCH] fix: check sites locally to avoid Cloudflare CDN timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit facts_collector was checking https://jarvis.orbishosting.com from the DO server itself — traffic routes through Cloudflare CDN which can return 524 timeouts. All sites are hosted on this same OLS instance, so check via http://127.0.0.1 with a Host header instead. This gives direct OLS response without CDN overhead. Co-Authored-By: Claude Sonnet 4.6 --- api/endpoints/facts_collector.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/endpoints/facts_collector.php b/api/endpoints/facts_collector.php index de2bdb1..0b36690 100644 --- a/api/endpoints/facts_collector.php +++ b/api/endpoints/facts_collector.php @@ -202,13 +202,19 @@ function collect_all(): array { ]; $down = []; foreach ($sites as $key => $url) { - $ch = curl_init($url); + $parsed = parse_url($url); + $host = $parsed['host'] ?? $url; + // Check sites on the local server directly to avoid Cloudflare CDN timeouts. + // All JARVIS-hosted sites are served from this same OLS instance. + $localUrl = 'http://127.0.0.1' . ($parsed['path'] ?? '/'); + $ch = curl_init($localUrl); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_NOBODY => true, + CURLOPT_HTTPHEADER => ["Host: $host"], ]); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);