mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-07 03:09:44 +03:00
Bookstack | docker linuxserver/bookstack + nginx-proxy-manager #2040
Closed
opened 2026-02-05 02:40:13 +03:00 by OVERLORD
·
18 comments
No Branch/Tag Specified
development
further_theme_development
l10n_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
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
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#2040
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 @eyduh on GitHub (Jan 14, 2021).
Describe the bug
I'm not sure if this fits here but it relates to the way that bookstack behaves when behind a reverse proxy. I'm not sure if it is a setting the bookstack .env or config.php that needs to be added or if it's a setting in my proxy manager.
The interface looks fine when connecting straight to the local IP of the server but when I setup jc21/nginx-proxy-manager to redirect https://books.mydomain.xyz to the server I'm served a broken html site with huge nav menu icons. (screenshot at the bottom)
Steps To Reproduce
nginx-proxy-manager forwards to http://my.server.local.ip:port with websocket support, force ssl, http2 & hsts enabled
I tried to add
APP_URL=https://books.domain.xyz
as well as the server IP:port and localhost:port
to the docker compose but then I get 502 bad gateway instead.
Expected behavior
As pretty of an interface as when I connect straight to the server.
Your Configuration (please complete the following information):
Version: BookStack v0.31.3
PHP: PHP 7.3.26
Install: https://hub.docker.com/r/linuxserver/bookstack
Additional context
It is running on an RaspberryPi 4 - 1GB ram with DietPi v6.34.3
nginx-proxy-manager is on the same pi
Screenshots

@maggie44 commented on GitHub (Jan 14, 2021):
I’m not familiar with nginx-proxy-manager, but if it is indeed nginx then somewhere in there will be an nginx.conf file which will likely need adjusting to fix it. Can you try and find that file and post it here?
@ssddanbrown commented on GitHub (Jan 15, 2021):
This is odd, setting that should only really change the URL in the response data, unless you're actually being redirect when accessing
https://books.domain.xyzto a URL which then fails.@devnope commented on GitHub (Jan 16, 2021):
Hi,
I faced the same issue as @eyduh ...
I think, I might have found a fix...
in my docker-compose file I changed the Portmapping to the following:
in the /etc/hosts:
the APP_URL is then
APP_URL="https://wiki.local"and the nginx has the following proxy url
I suppose, the problem with the app_url stuff is, that docker container can't answer the app_url without the portmapping and the etc/hosts relaying...
Setting the localhost in the port-mapping, the /etc/hosts and the nginx-config fixed it for me. I found out, that this was the issue for me, after I watched the site load with my browsers inspection mode running. Afterwards I tried to load the URLs for the CSS stuff. Then I noticed, that bookstack wasn't able to respond to wiki.local:6875. Maybe this helps reproducing and solving the issue in your config.
@coaqii commented on GitHub (Jan 19, 2021):
I faced this issue too after updating to a newer version of bookstack. With a newer version of the linuxserver bookstack image you need to pass APP_URL with the docker env variables. It ignores the variable set in the .env file and overwrites it.
Have you set this to your APP_URL?
@devnope commented on GitHub (Jan 23, 2021):
@coaqii I had set it in the docker-compose file
@eyduh commented on GitHub (Jan 23, 2021):
Sry, was preoccupied with some other issues.
Ok trying things one at a time:
APP_URL as environment variable
I set APP_URL=books.my.domain as an environment variable in the docker-compose part of portainer and I just get bad gateway. This is the same whether on it's own or with http:// or https://
APP_URL as env var. editing /etc/hosts & port mapping
APP_URL="https://books.local" as environment variable in the docker-compose portainer stack
setting ports: 127.0.0.1:6875
directing nginx-proxy-manager to http://books.local
editing both the docker /etc/hosts with
echo "127.0.0.1 books.local" >> /etc/hosts& the host system's /etc/hostsSame result as before.
nginx.conf etc
I would rather not mess with the .conf files directly, that's the whole point of having jc21/nginx-proxy-manager (npm). Since I could access it on http://local.ip.address:port before I started messing with APP_URL I should be able to do ssl termination and forward to that ip with npm as I have with some other stuff deployed through docker on the local network.
However, I did have to set some php variables in config.php for the nextcloud instance to forward properly. npm also offers to set custom nginx variables through the web interface but. c:
Anyway, here's the confs:
/etc/nginx/nginx.conf
and
/data/nginx/relevant.conf
/etc/nginx/fastcgi.conf
standard confs that reside in /etc/nginx/*
jc21/nginx-proxy-manager git
@ssddanbrown commented on GitHub (Jan 24, 2021):
The value will need to include
http://orhttps://. I still think it's odd that this is giving you bad gateway.@eyduh commented on GitHub (Jan 24, 2021):
No weird characters, the url I would like to use is basically https://books.my.domain
with ssl termination at nginx-proxy-manager running in its own portainer stack on the same machine.
so
https://books.my.domain -> DNS -> gets IP -> Nginx takes care of ssl & forwards https://books.my.domain requests to a either
http://servers.local.ip.address:port ,
http://hostname:port or
http://localhost:port
Should I set APP_URL to the local http://address:port or the public https://books.my.domain?
I use portainer and the docker-compose from linuxserver.io https://hub.docker.com/r/linuxserver/bookstack
I would set the environment variable in the docker-compose web editor, not the environment variable section after the web editor block.
docker-compose
I had a look both in the portainer log for the app and the db and it just tells me there are no logs?

If I attach to the image and have a look in /var/logs I find two empty folders, nginx & php
portainer inspect shows these processes running:
@cdrfun commented on GitHub (Feb 17, 2021):
@kdamianakis Please set up a separate issue to keep things separated. Make sure to add some details like your docker compose etc. I think this issue is a pretty good example of what's needed to solve an issue.
@cdrfun commented on GitHub (Feb 17, 2021):
@eyduh
The APP_URL should be https://books.my.domain in your case. The public-facing URL of bookstack.
I've noticed your bookstack and database volumes are the same. I'm not sure if that's a problem, but I'd locate these in separate folders to be sure. If you don't have anything in your database, just throw it away, so bookstack can set it up again.
@peracchi commented on GitHub (Mar 11, 2021):
Same problem as @eyduh and others.
Two days trying several proposed solutions, Google and whatever.
Important note: I already had this scenario working several months ago. Just redone everything using same config files. Only Bookstack is not working fine with Nginx Proxy Manager so I suppose the problem is in something that changed on Bookstack.
I can provide configs and logs but they are more or less equal to info already on thread.
@cdrfun commented on GitHub (Mar 11, 2021):
@peracchi Please set up a separate issue to keep things separated. Make sure to add some details like your docker compose etc. I think this issue is a pretty good example of what's needed to solve an issue.
@peracchi commented on GitHub (Mar 11, 2021):
I make it work again using the bellow files/settings:
/home/peracchi/docker/npm/docker-compose.yml
/home/peracchi/docker/bookstack/docker-compose.yml
Nginx Proxy Manager
I am using a Raspberry Pi 4 Model B Rev 1.2 with 4GB RAM and Manjaro ARM Linux aarch64 with Kernel 5.11.0-3-MANJARO-ARM as OS (best OS for RPI4 hands down! - use manjaro-arm-installer on your desktop and you will never look back).
Some references:
custom_docker_network -> https://nginxproxymanager.com/advanced-config/
Raspberry Pi 4 Minimal -> https://manjaro.org/download/#raspberry-pi-4-minimal
@eyduh @coaqii @devnope - if you try some or all settings above and it work for you please let me know.
@ssddanbrown commented on GitHub (Mar 12, 2021):
Since the original author has not replied in a while, and since the comment chain is getting a little confusing here, I'll close this off.
@MatthK commented on GitHub (May 15, 2023):
I just fired up a docker container and also tried to access the site behind an nginx reverse proxy. Experienced the same problem, that the CSS files were served as unsecure items via http:// instead of https://
I then changed the
APP_URL=http://bookstack.domain.comtoAPP_URL=https://bookstack.domain.comand it works flawelessy now.My nginx site file is nothing fancy, so that shouldn't have much impact.
@itsnanobug commented on GitHub (Jul 12, 2023):
I'm having this issue.
Everything but BookStack works.
I'm using Nginx Proxy Manager as my proxy and a wildcard certificate with Let's Encrypt through the Cloudflare API.
This part runs on Unraid, it will be changed in the future though.
It gives the strange view of BookStack that the OP had, that looks like the CSS messed up, but it works accessing it locally.

Here's a picture of the start
Currently my docker settings is the following (minus the password and stuff):
The current file for the reverse proxy:
The pictures from the Nginx Proxy Manager WebUI:


I've tried setting it to port 80/http as well, with the same issue.
I've tried different settings by changing one at a time, but no luck.
I've tried going over this video numerous time:
https://www.youtube.com/watch?v=dbDzPIv8Cf8&t=1376s
I'm not sure how to get it to work.
Any ideas?
@itsnanobug commented on GitHub (Jul 12, 2023):
Right after I posted this, I got it to work, so here I am again, posting my solution.
The APP_URL was the trickster for me.
I changed
-e 'APP_URL'='https://mydomain.com'so it wasn't an IP, or local host, but the actual domain I'm going to access it from.In Nginx Proxy Manager I pointed it to the IP address at port 80, in my case it's 10.0.10.32:80, and enabled the settings I wanted to.
@rdndsy commented on GitHub (Jun 7, 2024):
Same problem, fixed it with this method