diff --git a/server/routers/traefik/getTraefikConfig.ts b/server/routers/traefik/getTraefikConfig.ts index 789b2f82..7acdcabc 100644 --- a/server/routers/traefik/getTraefikConfig.ts +++ b/server/routers/traefik/getTraefikConfig.ts @@ -183,7 +183,7 @@ function createPathRewriteMiddleware( switch (rewritePathType) { case "exact": - // Replace the entire path with the exact rewrite path + // Replace the path with the exact rewrite path let exactPattern = `^${escapeRegex(path)}$`; middlewares[middlewareName] = { replacePathRegex: { @@ -549,10 +549,10 @@ export async function getTraefikConfig( config_output.http.middlewares = {}; } - // Add the middleware(s) to the config + // the middleware to the config Object.assign(config_output.http.middlewares, rewriteResult.middlewares); - // Add middleware(s) to the router middleware chain + // middlewares to the router middleware chain if (rewriteResult.chain) { // For chained middlewares (like stripPrefix + addPrefix) routerMiddlewares.push(...rewriteResult.chain); @@ -564,7 +564,6 @@ export async function getTraefikConfig( logger.info(`Created path rewrite middleware ${rewriteMiddlewareName}: ${resource.pathMatchType}(${resource.path}) -> ${resource.rewritePathType}(${resource.rewritePath})`); } catch (error) { logger.error(`Failed to create path rewrite middleware for resource ${resource.resourceId}: ${error}`); - // Continue without the rewrite middleware rather than failing completely } } diff --git a/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx b/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx index 4f81ed58..b37cfba9 100644 --- a/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx @@ -632,6 +632,8 @@ export default function ReverseProxyTargets(props: { ...row.original, path: null, pathMatchType: null, + rewritePath: null, + rewritePathType: null }); }} > diff --git a/src/app/[orgId]/settings/resources/create/page.tsx b/src/app/[orgId]/settings/resources/create/page.tsx index efb136cb..bb19cc79 100644 --- a/src/app/[orgId]/settings/resources/create/page.tsx +++ b/src/app/[orgId]/settings/resources/create/page.tsx @@ -610,6 +610,8 @@ export default function Page() { ...row.original, path: null, pathMatchType: null, + rewritePath: null, + rewritePathType: null }); }} >