Rules for rewriting requests to another path #843

Closed
opened 2026-04-05 17:52:29 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Pallavikumarimdb on 9/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?

*Originally created by @Pallavikumarimdb on 9/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. <img width="2578" height="794" alt="image" src="https://github.com/user-attachments/assets/65fcffa9-9048-4569-b14e-bddd49744a7d" /> <img width="1166" height="864" alt="image" src="https://github.com/user-attachments/assets/f9df4873-2c8f-4d32-9ef1-346bedf23cc0" /> ## How to test?
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#843