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
BookStack installed in subfolder (nginx) #1882
Comments
@MrksHfmn Yeah, It's totally possible. I've done it before by proxying the sub-path to another local URL or docker container URL. I've just tried to do it without proxies and secceeded by following this guide (TL;DR section). You'll need to set the APP_URL=http://sub.domain.org/bookstack Just make sure none of your BookStack files & folders are within/below another web-server directory on the file-system; None of the BookStack files outside of the |
@ssddanbrown Thank you for this tipp. I followed your mentioned guide (https://serversforhackers.com/c/nginx-php-in-subdirectory) and added the following nginx sections to use BookStack in a subfolder: location /bookstack {
Everything is working except the first request after a login. I'm always redirected to /bookstack/bookstack right after I click on the login button, which results in a page not found message in bookstack. After clicking on a created book ot shelv link, everything is working as excepted and no "page not found messages" appears. so it's only happening right after the login. I'm wondering if this is bug in the login php method or if there's still a tiny little problem in the nginx redirect rule. Another problem is the switch from bright to dark mode or the other way round. It's not working if you're using BookStack in a subfolder, because then I'm routed from the /subfolder back to /. Any help is appreciated. |
I discovered another (tiny) problem when you are moving BookStack into a subfolder. As far as I understand the favicon isn't delivered in the html head section in BookStack. That means the browser is always requesting for a possible favicon image from the root folder ("/favicon.ico") and that's not the correct one if you are moving BookStack into a subfolder if you have a favicon unter "/" from another web app. This could be solved if BookStack would deliver the favicon image with the base url from .env like so:
or in the subfolder case
There is no favicon for apple devices and no icon is shown under Safari, which could also be delivered in the head section:
|
Hi @FastHogi, In regards to the favicon, That's the behaviour I'd expect and prefer to remain. If someone is using bookstack on a sub-path of an existing site, I'd prefer to allow the favicon be used from that existing site. If needed, this can always be updated in BookStack, using the HTML examples you've shown, within the "Custom HTML Head Content" setting. Since there's been no response from the original author of this issue I'm going to close this off but if you have any further problems, feel free to open a new issue. |
Hi @ssddanbrown,
and yep, that works. Both favicons now appear perfectly on all devices from my subfolder. |
Had the same issue once login after putting a nginx server alias subfolder "mydomain.com/bookstack" to bookstack/public, the URL returns to mydomain.com/bookstack/bookstack with the latest bookstack version. Any update on solving this with nginx? Thanks! |
is it possible to run bookstack under a subfolder? I would like to call bookstack like this: https://sub.domain.org/bookstack
i use nginx, that's my current approach:
The text was updated successfully, but these errors were encountered: