Skip to content

Feat: Add proxy path feature - #260

Open
nodauf wants to merge 1 commit into
almeidapaulopt:mainfrom
nodauf:feat-ProxyPath
Open

Feat: Add proxy path feature#260
nodauf wants to merge 1 commit into
almeidapaulopt:mainfrom
nodauf:feat-ProxyPath

Conversation

@nodauf

@nodauf nodauf commented Apr 27, 2025

Copy link
Copy Markdown
Contributor

Hi,

This PR is related to the issue #153. I had a similar need, where the Pi-hole administration interface is located at /admin.

If you wish this feature to be implemented differently (for example, using a label like tsdproxy.dash.path: "/login"), let me know and I can adjust the implementation accordingly.

@nodauf nodauf mentioned this pull request Jun 4, 2025

@almeidapaulopt almeidapaulopt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this feature, @nodauf! The proxy path functionality would be very useful.\n\nI've reviewed the implementation carefully and I think it needs some important changes before it can be merged:\n\n### Current implementation:\nThe PR adds a ProxyPath field to PortConfig and appends the path to the DNS name displayed in the dashboard.\n\n### Issues:\n\n1. Path is only cosmetic — The path is appended to status.Self.DNSName in watchStatus(), which changes the displayed URL in the dashboard. However, the actual reverse proxy doesn't know about this path — requests to machine-name.ts.net/admin won't be routed to the container's /admin path.\n\n2. Hardcoded to port 443 — The code only looks at port 443 for the path:\ngo\nfor _, c := range p.config.Ports {\n if c.ProxyPort == 443 {\n path = c.ProxyPath\n }\n}\n\nThis should probably be per-port, not hardcoded.\n\n3. Path in DNS name — Appending a path to the DNS name (machine-name.ts.net/admin) is mixing URL structure with DNS. The DNS name should remain machine-name.ts.net and the path should be handled at the HTTP routing level.\n\n### Suggested approach:\n- The reverse proxy handler should strip/rewrite the path prefix when forwarding to the container\n- The path should be stored per-port in PortConfig and used in the HTTP handler, not just the status display\n- Consider implementing this as a label like tsdproxy.path=/admin rather than part of the port config string\n\nWould you be interested in revising the implementation? Happy to help discuss the approach! 😊

@almeidapaulopt
almeidapaulopt force-pushed the main branch 2 times, most recently from b720a3f to 28506e0 Compare May 7, 2026 23:40
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