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