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

BookStack CSS not loading behind letsencrypt reverse proxy #1204

Closed
secondsunrise opened this issue Jan 5, 2019 · 2 comments
Closed

BookStack CSS not loading behind letsencrypt reverse proxy #1204

secondsunrise opened this issue Jan 5, 2019 · 2 comments

Comments

@secondsunrise
Copy link

Describe the bug
This issue is similar to #801, #277, #272

I am setting up my BookStack docker behind a letsencrypt reverse proxy, but when I try to access the URL to login (https://bookstack.mydomain.com/login), the CSS does not load correctly which causes Mixed Content problems (see screenshot 1 and Additional context below).


Steps To Reproduce
I've tried several different variations of the BookStack APPURL but they either produce the same results or do not work at all:

https://bookstack.mydomain.com/login
https://bookstack.mydomain.com/bookstack
https://bookstack.mydomain.com/
https://bookstack.mydomain.com
https://mydomain.com
etc...

My letsencrypt entry for BookStack (I use this same block of code for several different web apps that are served up from letsencrypt so I know that it works, or should work):

## BookStack
server {
 	listen 443 ssl;
	root /config/www;
	index index.html index.htm index.php;
	server_name bookstack.*;
	include /config/nginx/ssl.conf;
	client_max_body_size 0;	
	location / {
		include /config/nginx/proxy.conf;
		proxy_pass http://10.0.0.3:6875;	
	}
}

I've also tried editing the proxy_pass line to https://10.0.0.3:6875/ but that just kills the page.


Expected behavior
Correct loading of CSS & normal login screen (see screen shot 2 below)


Screenshots

  1. What I see from https://bookstack.mydomain.com/login
    image

  2. What I see locally from http://10.0.0.3:6875/login
    image


Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.24.3
  • PHP Version: PHP 7.2.8 (cli) (built: Jul 24 2018 01:28:06) ( NTS )
  • Hosting Method (Nginx/Apache/Docker): Docker running on unRAID 6.6.6

Additional context
Mixed Content errors:

login:1 The source list for Content Security Policy directive 'frame-ancestors' contains an invalid source: 'https://bookstack.*'. It will be ignored.
login:13 Mixed Content: The page at 'https://bookstack.mydomain.com/login' was loaded over HTTPS, but requested an insecure stylesheet 'http://bookstack.mydomain.com:443/dist/styles.css?version=v0.24.3'. This request has been blocked; the content must be served over HTTPS.
login:14 Mixed Content: The page at 'https://bookstack.mydomain.com/login' was loaded over HTTPS, but requested an insecure stylesheet 'http://bookstack.mydomain.com:443/dist/print-styles.css?version=v0.24.3'. This request has been blocked; the content must be served over HTTPS.
login:71 Mixed Content: The page at 'https://bookstack.mydomain.com/login' was loaded over HTTPS, but requested an insecure image 'http://bookstack.mydomain.com:443/logo.png'. This content should also be served over HTTPS.
login:95 Mixed Content: The page at 'https://bookstack.mydomain.com/login' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://bookstack.mydomain.com:443/login'. This endpoint should be made available over a secure connection.
login:1 Mixed Content: The page at 'https://bookstack.mydomain.com/login' was loaded over HTTPS, but requested an insecure script 'http://bookstack.mydomain.com:443/dist/app.js?version=v0.24.3'. This request has been blocked; the content must be served over HTTPS.
@ssddanbrown
Copy link
Member

Hi @secondsunrise,
Sorry to hear you're having issues.

In your post you mentioned setting APPURL. Can you check the exact variable you are setting since this should be APP_URL.
I think this is a mistake in the linuxserver documentation, there's an active pull request outstanding to fix their readme.

@secondsunrise
Copy link
Author

secondsunrise commented Jan 7, 2019

I think this is a mistake in the linuxserver documentation

Yep, that must be the issue, I double checked the command that the linuxserver docker is running and it is using APPURL instead of APP_URL, good catch. Thank you for the help, I'll follow-up with the linuxserver team.

Command:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='bookstack' --net='bridge' -e TZ="America/Chicago" -e HOST_OS="Unraid" -e 'DB_HOST'='10.0.0.3:3306' -e 'DB_USER'='bookstack' -e 'DB_PASS'='xxxxxxxxxxxxx' -e 'DB_DATABASE'='bookstack' -e 'APPURL'='https://bookstack.mydomain.com' -e 'PUID'='99' -e 'PGID'='100' -p '6875:80/tcp' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack' 
db39701e151461f7d3f61917ccb76096c60035cfcda3b8582aeccd49595148d0

The command finished successfully!

EDIT: I got it working. For anyone who comes across this problem in the future, these are the steps I had to take:

  1. Click on the docker icon for BookStack from the unRAID console and click on Edit
  2. Click on the Basic View button at the top to change to Advanced View
  3. In the Extra parameters field, enter in -e 'APP_URL'='https://bookstack.yourdomain.com' (or however you have the bookstack URL setup with your reverse proxy server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants