mirror of
https://github.com/matze/wastebin.git
synced 2026-04-25 00:25:59 +03:00
[GH-ISSUE #176] How to run with prefix /foo with a remote proxy? #108
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wastebin-matze#108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MIvanchev on GitHub (Jul 8, 2025).
Original GitHub issue: https://github.com/matze/wastebin/issues/176
When using wastebin with nginx as reverse proxy I can reach the site through
https://<addr>/foobut then all the resources are fetched throughhttps://<addr>. Any way to fix that?@MIvanchev commented on GitHub (Jul 8, 2025):
P.S.
wastebin probably needs to support
X-Forwared-Prefix.@matze commented on GitHub (Jul 8, 2025):
There used to be an option to set a prefix but from a technical standpoint it was too cumbersome to keep. So
Forwarded(it's an actual standard header) is probably to the way to do it. But it requires quite a bit of change, so I can't promise anything at this point.@MIvanchev commented on GitHub (Jul 8, 2025):
Thanks! That's actually a significant disadvantage IMO if prefixes aren't supported. The cumbersome option is better than nothing.
@matze commented on GitHub (Jul 8, 2025):
I won't bring back the option but rather extract that info from a
Forwardedheader.@MIvanchev commented on GitHub (Jul 8, 2025):
That'll be perfect, I'm really eager to use it, being and Rust and so simple and straightforward, great work.
@matze commented on GitHub (Jul 9, 2025):
I think this is not even necessary and it actually stems from using absolute paths in a lot of places. Are you able to test from source?
@MIvanchev commented on GitHub (Jul 9, 2025):
Sure, if necessary I'll do it.
@MIvanchev commented on GitHub (Jul 21, 2025):
Yeah, any news on this one, I really need a good paster :))
@ItIsSeven commented on GitHub (Aug 1, 2025):
Also facing this issue as I wanted to host on a different path behind Nginx
I imagine
WASTEBIN_BASE_URLshould apply for the JS/CSS files etc. to resolve this issue@MIvanchev commented on GitHub (Dec 28, 2025):
Hey @matze I was thinking about this again, isn't the problem solvable through a layer to the router? If you want we could look at it together.
@matze commented on GitHub (Dec 28, 2025):
The routes themselves are not the problem, I tried exactly what you propose. The problem are URLs that are used in the templates. I tried using relative URLs where possible and it helped to a degree but not always.
@MIvanchev commented on GitHub (Dec 29, 2025):
Would it help to modify them like this
<link rel="stylesheet" href="{{ page.assets.css.dark.href() }}">and define the
hrefproperty to beprefix + route()?@MIvanchev commented on GitHub (Dec 29, 2025):
@matze I'm modding the templates and adding some path prefix, code. Could you tell me what this element is doing and how it should be prefixed?
@MIvanchev commented on GitHub (Dec 30, 2025):
Hey @matze, I've added some code to support prefixing. The correct header is
X-Forwarded-PrefixbecauseForwardedonly carries host info. Let me know what you think.