Skip to content
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

feat req : subpath event a full domain using prefix url #146

Closed
mckaygerhard opened this issue May 11, 2021 · 11 comments
Closed

feat req : subpath event a full domain using prefix url #146

mckaygerhard opened this issue May 11, 2021 · 11 comments

Comments

@mckaygerhard
Copy link

i check that in code all subpath are directories in the publicURL so tried for some option using publicURL and address option and chek tha tall the assets are rquesting from root.

so a new option "--prefixurl "subpath"" can be provided to use a prefix in all path ,

by example http://fbr.dom.fr will become http://fbr.dom.fr/subpath and we can server subpath then!

i made a dirty trick using a symlink in dataroot pointing to "." and it works, but rest of things of course not!

@ViBiOh
Copy link
Owner

ViBiOh commented May 12, 2021

It will add an unwanted complexity for manipulating path (which is already complex!). Most of the time, people have a reverse proxy in front of internet (for adding https, rate-limit or such things) and it allows to strip prefix.

@mckaygerhard
Copy link
Author

It will add an unwanted complexity for manipulating path (which is already complex!).

yes noted in the code.. puff .. but the prefix in the ROOTURL handler is not complex.. i mean in each request, we can inyect the subpath!

Most of the time, people have a reverse proxy in front of internet (for adding https, rate-limit or such things) and it allows to strip prefix.

that is i want to do but it seems for assets is not working, because the service defined the search for all in "root /" but i reverse proxy from a "/subpath" so the best way to illustrated is the crap happened with gitea golang code go-gitea/gitea#5411 and go-gitea/gitea#5425 (comment)

NOTE: gogs and gitea 1.X has a working behaviour for subpaths and defined url path.. so all the rest of webservers works and not only those craps named apache/nginx

@ViBiOh
Copy link
Owner

ViBiOh commented May 12, 2021

Indeed the PublicURL is not configured everywhere. Some paths are pointing the / which break compatibility. I can make all request prefixed with the PublicURL, with a reverse proxy in front will it solve your problem?

Edit: a prefixPath can also be an option. I'll open a pull-request for having materials to discuss

@mckaygerhard
Copy link
Author

sorry for bad english.. yes.. that's what i means.. of course this feature is not so easy to understand, checked the code and i was based in the public url handler so i'm not sure about security implications

ViBiOh added a commit that referenced this issue May 12, 2021
Closes #146

Signed-off-by: Vincent Boutour <bob@vibioh.fr>
@ViBiOh ViBiOh closed this as completed in 368580d May 13, 2021
@mckaygerhard
Copy link
Author

👍

@mckaygerhard
Copy link
Author

as i xplained in issue #152 all this commit 368580d has nothing to do with this issue, i guess. or at least can you xplain how to use the feature?

@ViBiOh
Copy link
Owner

ViBiOh commented May 17, 2021

All resources and redirections are now under the PublicURL prefix. If you set the PublicURL=https://website.com/fibr, all path will be prefixed. But, you're reverse proxy has to handle it by removing the prefix

curl https://website.com/fibr
-> Reverse proxy change the url to running fibr instance and remove the prefix at the same time, for exemple https://localhost:1080

Fibr handles the request and respond with url pointing to https://website.com/fibr (instead of / before)

@mckaygerhard
Copy link
Author

but now is happened that i xplain in the issue #152 , i mean :

1 started as fibr_linux_amd64 -noAuth -address "127.0.0.1" -publicURL "http://domain/files" -port 19000
2 put a reverse proxy for port 19000 as "http://domain/files"
3 when i try to visit, we have a loop and got "http://domain/files/files"

@ViBiOh
Copy link
Owner

ViBiOh commented May 17, 2021

Does your reverse proxy trim the prefix? For example on traefik or nginx

@mckaygerhard
Copy link
Author

Does your reverse proxy trim the prefix? For example on traefik or nginx

err no no, i means, i just want to star a 127.0.0.1 listen only and reverse proxy on subpath event full domain, and neither nginx things or apacheer crap..

the commit 368580d solves some problesm with fulldomain and reverse proxy setups but NOT FOR subpaths with already working webserver for a unique domain..

if i runs fibr_linux_amd64 -noAuth -address "127.0.0.1" -publicURL "http://domain/files" -port 19000 and reverse proxy http://domain/files to 10900 same path host .. does not work.. lighttp reverse proxy honors the headers and it seems this is not the case.. that's why i cited the gitea case and we nee a prefix path independient of the public url path so http service can property form the final complete url

@mckaygerhard
Copy link
Author

solved here: #152 (comment)

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

No branches or pull requests

2 participants