diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/https.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/https.rs b/src/https.rs index 7dcf051..c3c4550 100644 --- a/src/https.rs +++ b/src/https.rs @@ -153,14 +153,20 @@ async fn handle( .ok_or_else(|| anyhow!("Missing host header"))? .to_str()? }; + let domain = match host.split_once(':') { + Some((domain, _port)) => domain, + _ => host, + }; + debug!("Matching on domain {}", domain); + let path = req.uri().path(); let accept_encoding = accept_encoding_fork::encodings(req.headers()).unwrap_or_else(|_| vec![]); let best_match = proxy_config .entries .iter() - .filter(|ent| { - ent.host.matches(host) + .filter(|ent| { + ent.host.matches(domain) && ent .path_prefix .as_ref() |