Skip to content

Conversation

Pallavikumarimdb
Copy link
Member

@Pallavikumarimdb Pallavikumarimdb commented Sep 28, 2025

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

This PR introduces support for path rewriting rules.

  • Middleware creation for different rewrite strategies (exact, prefix, regex, stripPrefix).
  • Extended config generation to include path rewrite middlewares in router chains.
  • Ensures invalid rewrite configurations are logged and skipped.

This makes it possible to rewrite incoming request paths before forwarding to targets.
image

image

How to test?

@Pallavikumarimdb Pallavikumarimdb force-pushed the feature/path-rewriting-rules branch 2 times, most recently from f30d91b to 52db234 Compare September 29, 2025 17:53
@Pallavikumarimdb Pallavikumarimdb marked this pull request as ready for review September 29, 2025 18:55
@Pallavikumarimdb
Copy link
Member Author

Hi @oschwartz10612 , could you please review and let me know if any changes are needed?
@miloschwartz , can you also check if the UI requires any adjustments? Thanks!

@oschwartz10612
Copy link
Member

Couple small things:

  • I think if we are validating that we require the path to start with a / in the validatePathRewriteConfig we should also enforce that in the API, UI, and Blueprints. Alternatively we could prefix it with a / if it does not have one like on server/routers/traefik/getTraefikConfig.ts:617. I think same thing for stripPrefix
  • When using the strip option and leaving the value blank to strip I get [error]: Invalid path rewrite configuration for resource 1: Both rewritePath and rewritePathType must be specified together

As far as I can tell everything else works! We love the UI!

@Pallavikumarimdb Pallavikumarimdb force-pushed the feature/path-rewriting-rules branch from 2ce4337 to 8767d20 Compare October 1, 2025 07:36
@Pallavikumarimdb
Copy link
Member Author

@oschwartz10612 , I’ve made the requested changes. Could you please review and let me know if any further updates are needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants