18.04 Fresh Install - Links on page are absolute, not relative causing issue with HTTPS #701

Closed
opened 2026-02-04 21:55:26 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @rohitpaul on GitHub (May 31, 2018).

For Bug Reports

  • BookStack Version (Found in settings, Please don't put 'latest'): 0.22
  • PHP Version: 7.2.5
  • MySQL Version: 10.1.29-MariaDB-6
Expected Behavior

Running HAProxy in front of bookstack to handle SSL offloading.
When going to https://bookstack.mywebsite.com the site should work as it. The underlying HTML should point to all files either relative or absolute to include https in the address. This would cause the browser to accept the as it is not trying to load data from a non https location.

Current Behavior

Go to https://bookstack.mywebiste.com and browser gives error for mixed content. This causes an SSH error.

This can be verified by checking the source of the page. Example source for style sheet looks like this:

<link rel="stylesheet" href="http://bookstack.mywebsite.com/dist/styles.css?version=v0.22.0">

In 0.21 using the docker image, this worked fine and the style sheet code looked like this:

<link rel="stylesheet" href="/dist/styles.css?version=v0.21.0">
Steps to Reproduce

Use 18.04 installer for 0.22, but modified to remove mysql and add entries for the current mysql db.
HAProxy is setup to use the backend server on port 80. The URL rewrite is working correctly.

Navigate to new frontend defined in HAProxy to handle SSL on port 443.

Originally created by @rohitpaul on GitHub (May 31, 2018). ### For Bug Reports * BookStack Version *(Found in settings, Please don't put 'latest')*: 0.22 * PHP Version: 7.2.5 * MySQL Version: 10.1.29-MariaDB-6 ##### Expected Behavior Running HAProxy in front of bookstack to handle SSL offloading. When going to https://bookstack.mywebsite.com the site should work as it. The underlying HTML should point to all files either relative or absolute to include https in the address. This would cause the browser to accept the as it is not trying to load data from a non https location. ##### Current Behavior Go to https://bookstack.mywebiste.com and browser gives error for mixed content. This causes an SSH error. This can be verified by checking the source of the page. Example source for style sheet looks like this: ```html <link rel="stylesheet" href="http://bookstack.mywebsite.com/dist/styles.css?version=v0.22.0"> ``` In 0.21 using the docker image, this worked fine and the style sheet code looked like this: ```html <link rel="stylesheet" href="/dist/styles.css?version=v0.21.0"> ``` ##### Steps to Reproduce Use 18.04 installer for 0.22, but modified to remove mysql and add entries for the current mysql db. HAProxy is setup to use the backend server on port 80. The URL rewrite is working correctly. Navigate to new frontend defined in HAProxy to handle SSL on port 443.
OVERLORD added the 🐕 Support label 2026-02-04 21:55:26 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 31, 2018):

Hi @rohitpaul, Sorry to hear you are having problems.

Can you try setting APP_URL=https://bookstack.mywebiste.com in the .env file or as an environment variable?

This should force all URL's written by BookStack to start with this base domain.

@ssddanbrown commented on GitHub (May 31, 2018): Hi @rohitpaul, Sorry to hear you are having problems. Can you try setting `APP_URL=https://bookstack.mywebiste.com` in the `.env` file or as an environment variable? This should force all URL's written by BookStack to start with this base domain.
Author
Owner

@rohitpaul commented on GitHub (May 31, 2018):

@ssddanbrown thanks that works!

Can I get some help with added sed command. Not sure how to update the command.

sed -i.bak 's|# APP_URL=.*$|APP_URL=https://bookstack.mywebsite.com|' .env

Thanks for your help!

edit: I figured it out. I've updated my code in case anyone looks at this. Call this closed.

@rohitpaul commented on GitHub (May 31, 2018): @ssddanbrown thanks that works! Can I get some help with added sed command. Not sure how to update the command. ```bash sed -i.bak 's|# APP_URL=.*$|APP_URL=https://bookstack.mywebsite.com|' .env ``` Thanks for your help! edit: I figured it out. I've updated my code in case anyone looks at this. Call this closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#701