-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request : Install in a sub_path #20
Comments
It is nice when a web app has a built-in for this sort of thing, but it takes a bunch of code to get right in an app. It's not just prefixing URI routes, different users have different expectations about also rewriting Instead, I would recommend anyone hoping to deploy this at a subpath to instead route traffic first to a reverse proxy like nginx, have nginx rewrite URIs/headers/etc, then proxy_pass traffic to distbin. i.e. put a filter in front of distbin that does whatever you want, including subpath routing |
I'll leave this open until that functionality is added or there is example code and docs on how to do that with nginx. |
Well I tried installation managed using nginx rewrite: if ($scheme = http) { Rewrite of link works well but there something that nginx can't manage:
|
Will you elaborate on what URL 'is provided' and how/where? And what 'the good one' would be? Next week I should be able to recreate this and see what's up, but that info will help me think through it until then. |
Hard to explain, better with an example... Joined the source of the post from distbin-db/activities But I look at the post himself: https://test2.yh.yalh.net/distbin/activities/e44615fc-5d40-4770-a524-d5e035c8113b, there are some errors for some fields: |
|
@yalh76 I made some changes to make this possible, released as v1.2.0 and illustrated how they can be used with nginx over here: https://github.com/gobengo/distbin/tree/master/etc/distbin-nginx-subpath Try it out and let me know if it helps? |
Perfect working fine, implemented, tested and gone to production.
|
@yalh76 Were both of those images real screenshots? What is the difference between the configurations (ostensibly EXTERNAL_URL values + nginx.conf are what matters) for which the two images were captured? This is where that URL is built: distbin/src/distbin-html/public.ts Line 84 in 57ee1e9
distbin-html and the core distbin api are run logically separate. Traffic first comes into distbin-html, and then distbin-html makes JSON API calls to distbin. EDIT: I can just build this URL with a bit more awareness for if |
Yes they where real screenshots, took from the same instance, the second one was took after using a change_url script from Yunohost that let us move an application from one url to another one. To make it cleaner, I reinstalled two fresh from scratch distbin. I put for each the actual configuration .ENV and nginx configuration: and yes it's |
I just installed two other distbin removing the ending / for
Removing the ending / cause new problem:
PS: all the distbin instance may be available from internet |
Maybe it comes from the way the url is generated : distbin/src/distbin-html/public.ts Line 84 in 57ee1e9
in other pages, it uses distbin/src/distbin-html/partials.ts Line 93 in 57ee1e9
distbin/src/distbin-html/about.ts Line 17 in 57ee1e9
|
@yalh76 Yeah, I'm realizing that even url.resolve is no good because it assumes externalUrl will end in a trailing slash and: |
not urgent ^^ |
Would be interesting to be able to install it in a sub_path like http://www.example.com/distbin
Maybe the externalUrl: process.env.EXTERNAL_URL could be add to different links and mechanisms ^^
The text was updated successfully, but these errors were encountered: