[GH-ISSUE #565] [Feature Request] Ability to set passHostHeader to false on Auto created service for resource target #3449

Closed
opened 2026-04-20 07:24:31 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @oidebrett on GitHub (Apr 22, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/565

Originally assigned to: @uncle-tee on GitHub.

Currently, when you create a new resource and map this to a target, a service gets configured in Traefik. By default, this service sets the passHostHeader to true

There are some cases where its required to set passHostHeader to false such as when you are trying to proxy to an existing publicly accessible website with its own ssl.

for example

http:
  routers:
    add-http-router:
      rule: "Host(add.mydomain.com)"
      entryPoints:
        - websecure
      service: add-http-service
      tls: {}

  services:
    add-http-service:
      loadBalancer:
        servers:
          - url: "https://remote.externaldomain.com:443"
        passHostHeader: false  # <--- Important but doesnt get created by Pangolin nor any option for it
Originally created by @oidebrett on GitHub (Apr 22, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/565 Originally assigned to: @uncle-tee on GitHub. Currently, when you create a new resource and map this to a target, a service gets configured in Traefik. By default, this service sets the passHostHeader to true There are some cases where its required to set passHostHeader to false such as when you are trying to proxy to an existing publicly accessible website with its own ssl. for example ``` http: routers: add-http-router: rule: "Host(add.mydomain.com)" entryPoints: - websecure service: add-http-service tls: {} services: add-http-service: loadBalancer: servers: - url: "https://remote.externaldomain.com:443" passHostHeader: false # <--- Important but doesnt get created by Pangolin nor any option for it ```
GiteaMirror added the good first issuehelp wanted labels 2026-04-20 07:24:31 -05:00
Author
Owner

@miloschwartz commented on GitHub (Apr 23, 2025):

This is easy to add, hope to get to it soon. If anyone sees this and wants to start a PR, please do! Thanks for the suggestion.

<!-- gh-comment-id:2822815419 --> @miloschwartz commented on GitHub (Apr 23, 2025): This is easy to add, hope to get to it soon. If anyone sees this and wants to start a PR, please do! Thanks for the suggestion.
Author
Owner

@uncle-tee commented on GitHub (Apr 30, 2025):

I will happily take this since I am just getting to understand Pangolin Internals. Can you assign to me?

<!-- gh-comment-id:2843655298 --> @uncle-tee commented on GitHub (Apr 30, 2025): I will happily take this since I am just getting to understand Pangolin Internals. Can you assign to me?
Author
Owner

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

Thanks @uncle-tee let us know if you have any questions!

<!-- gh-comment-id:2847413601 --> @oschwartz10612 commented on GitHub (May 2, 2025): Thanks @uncle-tee let us know if you have any questions!
Author
Owner

@uncle-tee commented on GitHub (May 4, 2025):

At the moment, Pangolin is not adding the header host middleware to the router, I will raise a PR to add this. @oschwartz10612 Is this a right approach?

Since Pangolin provides a middleware for setting the Host header, even if passHostHeader: false is set, the middleware will override it. Let me know if you need any further help.

<!-- gh-comment-id:2849197097 --> @uncle-tee commented on GitHub (May 4, 2025): At the moment, Pangolin is not adding the header host middleware to the router, I will raise a PR to add this. @oschwartz10612 Is this a right approach? > Since Pangolin provides a middleware for setting the Host header, even if` passHostHeader: false` is set, the middleware will override it. Let me know if you need any further help.
Author
Owner

@uncle-tee commented on GitHub (May 4, 2025):

At the moment, Pangolin is not adding the header host middleware to the router, I will raise a PR to add this. @oschwartz10612 Is this a right approach?

I just confirmed that the middleware is added by Pangolin, so I think you just have to update your configuration by simply adding hostname under Custom Host Header in the proxy settings.

<!-- gh-comment-id:2849205534 --> @uncle-tee commented on GitHub (May 4, 2025): > At the moment, Pangolin is not adding the header host middleware to the router, I will raise a PR to add this. [@oschwartz10612](https://github.com/oschwartz10612) Is this a right approach? > I just confirmed that the middleware is added by Pangolin, so I think you just have to update your configuration by simply adding hostname under Custom Host Header in the proxy settings.
Author
Owner

@miloschwartz commented on GitHub (Sep 27, 2025):

Thanks, converting this to a discussion thread so others can upvote and participate!

<!-- gh-comment-id:3342089991 --> @miloschwartz commented on GitHub (Sep 27, 2025): Thanks, converting this to a discussion thread so others can upvote and participate!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#3449