This commit is contained in:
Christoffer Martinsson 2025-10-12 16:37:40 +02:00
parent 002c17d23d
commit 18fc1f5b16

View File

@ -790,12 +790,15 @@ impl ServiceCollector {
// Extract routing information // Extract routing information
if trimmed.starts_with("return") && trimmed.contains("301") { if trimmed.starts_with("return") && trimmed.contains("301") {
// Redirect: return 301 https://example.com$request_uri; // Skip simple HTTPS redirects (return 301 https://$host$request_uri)
if let Some(url_start) = trimmed.find("https://") { if !trimmed.contains("$host") {
let url_part = &trimmed[url_start..]; // Meaningful redirect: return 301 https://pages.cmtec.se$request_uri;
if let Some(url_end) = url_part.find('$') { if let Some(url_start) = trimmed.find("https://") {
let redirect_url = &url_part[..url_end]; let url_part = &trimmed[url_start + 8..]; // Skip "https://"
destinations.push(format!("{}", redirect_url)); if let Some(url_end) = url_part.find('$') {
let domain = &url_part[..url_end];
destinations.push(format!("{}", domain));
}
} }
} }
} else if trimmed.starts_with("proxy_pass") { } else if trimmed.starts_with("proxy_pass") {
@ -813,7 +816,7 @@ impl ServiceCollector {
let path_part = &trimmed[path_start..]; let path_part = &trimmed[path_start..];
if let Some(path_end) = path_part.find(';') { if let Some(path_end) = path_part.find(';') {
let root_path = &path_part[..path_end]; let root_path = &path_part[..path_end];
destinations.push(format!("📁 {}", root_path)); destinations.push(format!("static {}", root_path));
} }
} }
} }