fix(reverse_proxy): add wildcard for route

This commit is contained in:
xfy
2025-06-01 21:55:19 +08:00
parent 1b3fcf7443
commit 2bc6adce84

View File

@ -44,6 +44,9 @@ pub async fn make_server(host: SettingHost) -> anyhow::Result<()> {
// reverse proxy // reverse proxy
if host_route.proxy_pass.is_some() { if host_route.proxy_pass.is_some() {
router = router.route(host_route.location.as_ref(), get(reverse_proxy::serve)); router = router.route(host_route.location.as_ref(), get(reverse_proxy::serve));
// register wildcard path /doc/*
let route_path = format!("{}{{*path}}", host_route.location);
router = router.route(route_path.as_ref(), get(reverse_proxy::serve));
// save route path to map // save route path to map
{ {
host_to_save host_to_save