diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index dd23ca0..e95f7f4 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -739,8 +739,9 @@ impl SystemdCollector { while i < lines.len() { let line = lines[i].trim(); if line.starts_with("server") && line.contains("{") { - if let Some((server_name, proxy_url)) = self.parse_server_block(&lines, &mut i) { - sites.push((server_name, proxy_url)); + if let Some(server_name) = self.parse_server_block(&lines, &mut i) { + let url = format!("https://{}", server_name); + sites.push((server_name.clone(), url)); } } i += 1; @@ -751,7 +752,7 @@ impl SystemdCollector { } /// Parse a server block to extract the primary server_name - fn parse_server_block(&self, lines: &[&str], start_index: &mut usize) -> Option<(String, String)> { + fn parse_server_block(&self, lines: &[&str], start_index: &mut usize) -> Option { use tracing::debug; let mut server_names = Vec::new(); let mut proxy_pass_url = None; @@ -806,15 +807,7 @@ impl SystemdCollector { *start_index = i - 1; if !server_names.is_empty() && !has_redirect { - if let Some(proxy_url) = proxy_pass_url { - // Site with proxy_pass: check backend, show "P" prefix - let proxied_name = format!("P {}", server_names[0]); - return Some((proxied_name, proxy_url)); - } else { - // Site without proxy_pass: check external HTTPS - let external_url = format!("https://{}", server_names[0]); - return Some((server_names[0].clone(), external_url)); - } + return Some(server_names[0].clone()); } None