mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-23 03:09:40 +03:00
possibility that the application work in a subdirectory of a site #42
Closed
opened 2026-02-04 16:19:15 +03:00 by OVERLORD
·
24 comments
No Branch/Tag Specified
development
l10n_development
release
v25-12
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.7
v25.12.6
v25.12.5
v25.12.4
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🛠️ Enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#42
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 @fibis on GitHub (Jan 4, 2016).
@ssddanbrown commented on GitHub (Feb 27, 2016):
Hi,
Sorry for combing back to this late. If I'm honest I'm a little wary of this one. Allowing subdirectory placement of BookStack has the side effect of making it easy to have all the app files within publicly accessible space thus opening it up to all kinds of possible security issues.
I'm sure there's ways around this with careful apache/nginx/other config editing but it would make things too easy to get wrong. At the moment the set-up somewhat forces you to have a more secure structure or at least makes you think about it.
I understand that it would make things easier for using on shared web services but these days decent VPS solutions are becoming very affordable so this is becoming less of an issue.
This is definitely technically possible to do, It's just my gut feeling is against it.
I will leave this issue open for discussion though so potential solutions/reasoning's can be added.
@tpetrauskas commented on GitHub (Mar 26, 2016):
This would be definitely a security flow. The server administrator could use Apache2 aliases for that functionality (as phpMyAdmin is using by default).
@chorsnell commented on GitHub (Aug 9, 2016):
Running into issues with a dockerised container, and nginx reverse proxy to put it on a sub directory. Loads but all the CSS / JS is pointing at the wrong place, and navigating anywhere breaks.
Tried with and without the rewrite rules, but doesn't seem to have any effect, any ideas?
@ssddanbrown commented on GitHub (Aug 9, 2016):
@poppahorse Yeah, Pretty much all links and assets are referenced as root relative. Need to go over all links and covert them to be app relative.
Since you've shown a good use case of using BookStack in a subdomain securely (Proxying to a docker container) I'll remove the 'Open to discussion' label and mark this as something to be done.
@chorsnell commented on GitHub (Aug 10, 2016):
Awesome thanks! I know this issue is an oldie, and dont want to sound pushy, but any idea of a rough timeline? 😛
Got 4 projects lined up that I'd love to use bookstack for, 2 of them fairly imminent 😃
@ssddanbrown commented on GitHub (Aug 11, 2016):
@poppahorse I was looking to do a bit of BookStack bug-bash session this weekend. If I have enough time I'll include this within the bug-bash.
@chorsnell commented on GitHub (Aug 11, 2016):
thanks, that would be great! for the prompt responses 👍
@ssddanbrown commented on GitHub (Aug 14, 2016):
Okay this should now be possible as of v0.11.1 that was just released. I'll add the process to the docs soon but, in general, you need to re-write the requests like in the example nginx config above and set the
APP_URLparam in the.envfile to your full path.There were quite a few areas in the app that were updated to allow this so there's a good chance I've missed a few changes. If you come across any links or redirects that don't include the extra path component just open a new issue.
@poppahorse I tested using pretty much the same nginx config as you posted but I proxied to another Nginx site. I have not yet tested it proxying to docker but I'm hoping it shouldn't be any different.
@chorsnell commented on GitHub (Aug 15, 2016):
thanks @ssddanbrown much appreciated on the quick turnaround, I will hopefully have time to have a play with this later today, will let you know how it goes.
@chorsnell commented on GitHub (Aug 18, 2016):
So I have discovered a few places where the baseUrl is required, I made a PR for the initial login one, but how would you prefer the others? In here?
Also how does it save / store the
Application namefield and settings like primary color? Managed to get 2 copies up and running at:http://domain/docs/project
http://domain/docs/project2
But despite them having their own database, they seem to share those settings. Any ideas? :)
@ssddanbrown commented on GitHub (Aug 18, 2016):
@poppahorse List any additional url's in the comments of the pull request. I'll go through this weekend and send out another bugfix release to implement them.
Application settings are saved in the database and are also cached. Could the cache be shared across both in your setup? By default it's stored in the application
storagefolder unless you've set up memcached or redis.@chorsnell commented on GitHub (Aug 18, 2016):
Will do on the other URLs, thanks :)
And cool, that makes sense re: cache. I will have a play!
@montharon commented on GitHub (Aug 20, 2016):
I'm currently also struggling the get BookStack running on my RaspberryPi.
I have other different webfolders (for instance baikal, grav, mediawiki) running on my NGINX server.
Therefore, I will have to use BookStack in it's separate subfolder on my public root.
I have tried various configurations of my NGINX default config to get BookStack running and I also did change the .env setting to http://192.168.0.12/subfolder, but without any luck ;(
@poppahorse
Do you have a running version of your NGINX config for me ;)
I just wanted to have BookStack running in its own subfolder, for instance /bookstack
and redirect all incoming request on that url to /bookstack/public
Is there already a version that can be installed in a subfolder?
I have cloned the latest release from github...
Many thanks and advance and @ssddanbrown keep up the great work!
montharon
@ssddanbrown commented on GitHub (Aug 20, 2016):
@montharon Thanks!
I do not recommend installing BookStack within an actual subfolder as it can expose a lot of files which should not be publically accessible. The latest version (v0.11.1) allows you to install BookStack on a URL sub-path (Such as http://domain.com/bookstack) but this should be done via proxying.
I will update the docs with this soon but for now I have created a gist with the nginx config I used to test this. This can be found here. I have commented it up so hopefully you can follow it okay. Will take a little nginx experience. Give me a shout if you have any issues.
@montharon commented on GitHub (Aug 20, 2016):
@ssddanbrown
Many, many thanks for your quick reply!
According to your suggested gist I changed my config to the following:
My NGINX default config
Unfortunately this does not work either, since every request is automatically redirected to
192.168.0.12/login
Any suggestions?
Many thanks in advance,
montharon
@ssddanbrown commented on GitHub (Aug 20, 2016):
@montharon Have you set the
APP_URLparam in the BookStack.envfile to be your desired url? I forgot to mention that in my post above.@montharon commented on GitHub (Aug 20, 2016):
@ssddanbrown
I have set the APP_URL in the .env file to
http://192.168.0.12/bs
@ssddanbrown commented on GitHub (Aug 20, 2016):
@montharon Okay, It might not be to do with your setup then, Could be #166 at play here. Planning to send another bugfix release out tomorrow to cover that.
@montharon commented on GitHub (Aug 20, 2016):
@ssddanbrown Wow, that's good news! Your support and work is much appreciated!
@ssddanbrown commented on GitHub (Aug 21, 2016):
@montharon I've just published a new release. Give that a try and let me know how it goes.
@montharon commented on GitHub (Aug 21, 2016):
@ssddanbrown Many, many thanks to you Dan! Now it works like a charme ;)
The only thing that I figured out that it's not possible to export a page as PDF file.
The auto-generated URL looks like this:
http://192.168.0.12/docs/books/book01/page/page01/export/pdfCheers,
montharon
@ssddanbrown commented on GitHub (Aug 21, 2016):
Hey @montharon, Glad its now working. That PDF export link looks correct & PDF exports are working okay for me, What's the issue you're getting? Info about viewing error output can be found here.
@montharon commented on GitHub (Aug 21, 2016):
@ssddanbrown Hmmmm, set the debugging to true in the .env file and exported a page...
No errors, but a blank page and nothing to download.
Checked the naravel.log also, but found nothing special or unexpected...
@minecraftchest1 commented on GitHub (Jul 2, 2021):
I have just installed BookStack on my pi with a symlink from /opt/BookStack/public to /var/www/html/bookstack. I was able to access the long page, but then I got a ERR_TOO_MANY_REDIRECTS error.
