[GH-ISSUE #804] Support for custom location routing (similar to NPM “Custom location”) #18729

Closed
opened 2026-05-21 18:44:13 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @garanda21 on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/804

Hi! First of all, thank you for the work on Pangolin — it’s a very promising project.

I have a use case that I can easily solve in NPM (Nginx Proxy Manager) using the Custom location feature, and I’m wondering if something similar currently exists in Pangolin, or if there are plans to support it.

For example, in NPM I can define a custom location like this:

location /api/ {
    rewrite ^/api(/.*)$ $1 break;
    proxy_pass http://rybbit_backend:3001;
}

This is essential for a frontend application like Rybbit, which expects its backend to be available under a prefixed path such as /api. With just a couple of clicks in NPM, I can set this up and everything works perfectly.

If Pangolin aims to be a viable alternative, I believe this kind of routing configuration is critical — especially for developers who aren’t experts in Traefik or its middleware system. Ideally, we should be able to configure such behavior via the UI without editing configuration files manually, which can be risky and defeats the purpose of a user-friendly proxy manager.

Is this kind of functionality currently possible? If not, are there any plans to support it?

Thanks again, and keep up the great work!

Originally created by @garanda21 on GitHub (May 29, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/804 Hi! First of all, thank you for the work on Pangolin — it’s a very promising project. I have a use case that I can easily solve in NPM (Nginx Proxy Manager) using the **Custom location** feature, and I’m wondering if something similar currently exists in Pangolin, or if there are plans to support it. For example, in NPM I can define a custom location like this: ``` location /api/ { rewrite ^/api(/.*)$ $1 break; proxy_pass http://rybbit_backend:3001; } ``` This is essential for a frontend application like [Rybbit](https://github.com/rybbit-io/rybbit), which expects its backend to be available under a prefixed path such as /api. With just a couple of clicks in NPM, I can set this up and everything works perfectly. If Pangolin aims to be a viable alternative, I believe this kind of routing configuration is critical — especially for developers who aren’t experts in Traefik or its middleware system. Ideally, we should be able to configure such behavior via the UI without editing configuration files manually, which can be risky and defeats the purpose of a user-friendly proxy manager. Is this kind of functionality currently possible? If not, are there any plans to support it? Thanks again, and keep up the great work!
Author
Owner

@viriatusX commented on GitHub (May 29, 2025):

+1 for this, please 🙏

<!-- gh-comment-id:2920406976 --> @viriatusX commented on GitHub (May 29, 2025): +1 for this, please 🙏
Author
Owner

@kmanwar89 commented on GitHub (May 29, 2025):

You can accomplish this using the replace or redirect regex options available within Traefik - I'm actually trying to get this working right now such that api.example.com redirects to api.example.com/v1/docs automatically, but I'm not having great luck with it.

Personally I used NPM for years and had so many issues with it that I ended up moving away from it to Traefik, which allowed me to be more comfortable w/ Pangolin as it uses Traefik as it's reverse proxy. That rewrite rule you have is almost exactly the same as the replacePath function. Hopefully that document helps you, and good luck!

<!-- gh-comment-id:2920633528 --> @kmanwar89 commented on GitHub (May 29, 2025): You can accomplish this using the `replace` or `redirect` regex options available within Traefik - I'm actually trying to get this working right now such that `api.example.com` redirects to `api.example.com/v1/docs` automatically, but I'm not having great luck with it. Personally I used NPM for years and had so many issues with it that I ended up moving away from it to Traefik, which allowed me to be more comfortable w/ Pangolin as it uses Traefik as it's reverse proxy. That `rewrite` rule you have is almost exactly the same as the [`replacePath`](https://doc.traefik.io/traefik/middlewares/http/replacepath/) function. Hopefully that document helps you, and good luck!
Author
Owner

@goldflag commented on GitHub (May 30, 2025):

Note about Rybbit specifically - in the latest release the /api rewrite is removed but Rybbit still expects the custom location

<!-- gh-comment-id:2923308267 --> @goldflag commented on GitHub (May 30, 2025): Note about Rybbit specifically - in the [latest release](https://github.com/rybbit-io/rybbit/releases/tag/v1.0.0) the `/api` rewrite is removed but Rybbit still expects the custom location
Author
Owner

@viriatusX commented on GitHub (May 30, 2025):

Note about Rybbit specifically - in the latest release the /api rewrite is removed but Rybbit still expects the custom location

Yes, I have seen it. Thanks
Hopefully Pangolin / Traefik will include the Custom Location. It is a must have.

<!-- gh-comment-id:2923322890 --> @viriatusX commented on GitHub (May 30, 2025): > Note about Rybbit specifically - in the [latest release](https://github.com/rybbit-io/rybbit/releases/tag/v1.0.0) the `/api` rewrite is removed but Rybbit still expects the custom location Yes, I have seen it. Thanks Hopefully Pangolin / Traefik will include the Custom Location. It is a must have.
Author
Owner

@garanda21 commented on GitHub (May 30, 2025):

Personally I used NPM for years and had so many issues with it that I ended up moving away from it to Traefik, which allowed me to be more comfortable w/ Pangolin as it uses Traefik as it's reverse proxy. That rewrite rule you have is almost exactly the same as the replacePath function. Hopefully that document helps you, and good luck!

Thanks for the heads-up. The rewrite rule might work, but we still need the custom location for the proxy_pass

<!-- gh-comment-id:2923378043 --> @garanda21 commented on GitHub (May 30, 2025): > Personally I used NPM for years and had so many issues with it that I ended up moving away from it to Traefik, which allowed me to be more comfortable w/ Pangolin as it uses Traefik as it's reverse proxy. That `rewrite` rule you have is almost exactly the same as the [`replacePath`](https://doc.traefik.io/traefik/middlewares/http/replacepath/) function. Hopefully that document helps you, and good luck! Thanks for the heads-up. The `rewrite` rule might work, but we still need the custom location for the `proxy_pass`
Author
Owner

@garanda21 commented on GitHub (May 30, 2025):

Note about Rybbit specifically - in the latest release the /api rewrite is removed but Rybbit still expects the custom location

Hopefully, the Pangolin devs will add similar functionality in the future, also great news for Rybbit removing the rewrite!

<!-- gh-comment-id:2923381625 --> @garanda21 commented on GitHub (May 30, 2025): > Note about Rybbit specifically - in the [latest release](https://github.com/rybbit-io/rybbit/releases/tag/v1.0.0) the `/api` rewrite is removed but Rybbit still expects the custom location Hopefully, the Pangolin devs will add similar functionality in the future, also great news for Rybbit removing the rewrite!
Author
Owner

@oschwartz10612 commented on GitHub (May 31, 2025):

Great idea! I will move this to a discussion just for tracking purposes. We can try to get to something like this soon!

<!-- gh-comment-id:2925280199 --> @oschwartz10612 commented on GitHub (May 31, 2025): Great idea! I will move this to a discussion just for tracking purposes. We can try to get to something like this soon!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#18729