Feature Request: Custom Headers for Individual Pangolin Resources #455
Replies: 15 comments 11 replies
-
https://forum.hhf.technology/t/enhancing-your-pangolin-deployment-with-middleware-manager/ With this you can set it per resources any middlwares |
Beta Was this translation helpful? Give feedback.
-
jumping in to echo what others have already surfaced here. I've been testing Pangolin + Newt for exposing multiple internal services from my home lab (Sonarr, Plex, Bookstack, etc.), and while the install experience was beautifully simple, I'm running into the same core issue: 🛑 "404 page not found" for anything relying on hostname-based routing or redirects. My setup uses: The Problem This applies regardless of whether the backend is on Docker, Kubernetes, or a plain VM — if it relies on Host-based routing or absolute URLs, it fails through Pangolin. Request for Enhancement This would bring it in line with what we get from tools like Traefik or NGINX reverse proxy, and make Pangolin + Newt a true drop-in solution for homelabbers with complex internal DNS setups. Let me know if you'd like any logs or configs — I’m happy to help test or provide more info. Thanks for the awesome work so far 🙌 |
Beta Was this translation helpful? Give feedback.
-
@gtbdf1 Hope to clean up some of this basic proxy functionality / expose more raw Traefik features soon after we knock out some of these larger system components like external IDP support, etc. I agree, stuff like this is needed for true adoption as the proxy is super basic at the moment. Thanks for the tips! |
Beta Was this translation helpful? Give feedback.
-
Bumping this |
Beta Was this translation helpful? Give feedback.
-
I'm really waiting on this too. I'm pretty new to the homelab/self-hosting hobby, but I now have my basic working setup and am polishing stuff. I started to look into a solution, thinking that this would be a piece of cake, as this requirement seems obvious with regard to proxy and self-hosting. But soon I realised this is far from a standard and mostly due to the diversity of solutions existing for connecting the multitude of services, choosing each their own way of implementation. So right now, I concluded that this requires collaboration (of course) of the two endpoints (proxy/Pangolin and the connected service), which is not yet ready on either side. Many of the services I'm looking into either:
Even in a good scenario, I observed a bad result, for example, playing around with Pocket-Id OAuth as a front-end before Pangolin, and then accessing a service that supports OAuth too, I got a "two-login" phase: first OAuth sequence to Pangolin, then a second OAuth sequence to the service. The first sequence did not transfer the context, causing a bad user experience. I can't get what is missing there? @hhftechnology
Inspecting the login-sequence, I don't see Pangolin setting any standard header at all. It is just using p_session_token, am I missing something? I would expect indeed to find the current log-in username, possibly the email as well, but nothing was present. This would be a first step to try modify some of the services I'm using. Do you have implementation detail on that part, what Pangolin is doing right now? And finally, just out of curiosity, how are you all doing currently, to address/work-around this issue? Any good tools/configuration to suggest? |
Beta Was this translation helpful? Give feedback.
-
So I am having issue, where I need to add Access-Control-Allow-Origin header to the proxied response for a subdomain. Is this what is meant by this feature request? i.e. we can't do this already? |
Beta Was this translation helpful? Give feedback.
-
How to add for example custom header for transmission rpc required? Nginx equivalent is - proxy_pass_header X-Transmission-Session-Id; Adding as X-Transmission-Session-Id does noting. |
Beta Was this translation helpful? Give feedback.
-
Hi! I use iOS native apps (like immich) that do not support any kind of special authentication, except OIDC for login. When a ressource is secured by pangolin, this app cannot connect to it. Using Cloudflare I setup custom authentication header - a code that's setup within the app to authenticate for access to the ressource. That is working good and the ressource does not have to be public. Is this meant to be possible with this feature? |
Beta Was this translation helpful? Give feedback.
-
Yes, Immich App does work/support this (at least on Android). In Settings > Advanced > custom proxy headers |
Beta Was this translation helpful? Give feedback.
-
I've run into this same problem trying to configure Wordpress. It needs X-Fordwarded-For but I cannot figure out how to add that to Pangolin. |
Beta Was this translation helpful? Give feedback.
-
For the few people just want to send some headers like basic authentication to the backend I quickly threw together a small container that adds that functionality until pangolin has it natively. https://github.com/lhw/pangolin-patcher |
Beta Was this translation helpful? Give feedback.
-
In my humble opinion, the priority on this item should be bumped to 100 and it is a real shocker (to everyone's surprise) to see that this is not treated as such! As more and more people start replacing their HAProxy and NGINX setups to use Pangolin, they are all finding that they really cannot do it yet as something as basic as setting and tuning forwarded headers is absent from this solution without going through an increasingly complex set of workarounds and configurations. This is definitely the last thing holding a lot of us making the switch and most definitely losing the product owners of a much larger fan base! |
Beta Was this translation helpful? Give feedback.
-
Additionally it's the best way to get rid of path rules for a lot of Android and iOS apps that have no option the use custom headers with them. The allowed path rules open new security flaws and undermine the purpose of Pangolin security features imo. |
Beta Was this translation helpful? Give feedback.
-
Want to do this soon! :}
|
Beta Was this translation helpful? Give feedback.
-
Would love for this to be implemented |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Currently, Pangolin doesn't provide a way to set custom HTTP headers for individual resources. We request the ability to configure custom request and response headers for each resource, similar to Cloudflare's Transform Rules for HTTP Request Header Modification.
Problem Statement
When proxying to various backend services, different applications often require specific HTTP headers for proper functionality, authentication, or integration. Without the ability to customize headers at the resource level, users must:
Use Cases
Authorization
,X-API-Key
, or service-specific auth headersAccess-Control-Allow-Origin
for specific servicesX-Forwarded-For
,X-Real-IP
with appropriate valuesX-Requested-With
Proposed Implementation
Feature Capabilities
UI Integration
Add a new "Headers" tab within each resource configuration alongside the existing "Connectivity" and "Authentication" tabs:
Technical Architecture
Configuration Data Model
Implementation Details
Database Schema Update:
header_rules
table to store header configurationsBackend API Endpoints:
GET /api/v1/resources/{resourceId}/headers
- List headers for a resourcePOST /api/v1/resources/{resourceId}/headers
- Add a headerPUT /api/v1/resources/{resourceId}/headers/{headerId}
- Update a headerDELETE /api/v1/resources/{resourceId}/headers/{headerId}
- Delete a headerTraefik Integration:
UI Components:
Example Configuration in Traefik
User Experience
Adding a Header Rule
Migration Consideration
The feature should include:
Security Considerations
Next Steps
We believe this feature would significantly improve Pangolin's flexibility and usefulness for various self-hosting scenarios, allowing it to better serve diverse applications without requiring additional proxies or manual Traefik configuration.
Beta Was this translation helpful? Give feedback.
All reactions