diff --git a/apps/sn/middleware.ts b/apps/sn/middleware.ts index 8a1a2e716..16b9c7d5a 100644 --- a/apps/sn/middleware.ts +++ b/apps/sn/middleware.ts @@ -50,6 +50,14 @@ export function middleware(req: NextRequest) { return rewriteWith(newUrl, req, true); } + if (pathname.startsWith("/api/proxy")) { + const decodedQuery = toDecodedQueryString(searchParams); + const newUrl = `${SERVER_API_URL}${pathname}${decodedQuery ? `?${decodedQuery}` : "" + }`; + console.log(`[Middleware] Rewriting from '/server' path to: ${newUrl}`); + return rewriteWith(newUrl, req, true); + } + if (pathname.startsWith("/geoserver")) { let queryParams = searchParams.toString(); const typename = searchParams.get("TYPENAME");