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);