Protocol agnostic behaviour to support reverse proxy and HTTPS #357

Closed
opened 2026-02-04 18:58:36 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @mry on GitHub (Jun 10, 2017).

Setup

BookStack (in Docker) behind a reverse proxy (nginx).
BookStack service listens on ip:port and reverse proxy exposes ip:443 and proxies https://ip:443 to http://bookstack_ip:port.
The App_url is set to the public proxy address: https://ip:443

BookStack v0.16.2 Save Settings

For Feature Requests

Not have URLs hardcoded/saved or logic which are dependant on protocol.

Expected Behavior

Honor the App_Url if urls are rewritten and/or user redirected

Actual Behavior

The issues arises in numerous places but for instance Creating a New page results in a url without HTTPS.

  1. Initial Page: https://ip/books/name_of_book
  2. Click Create, which points to: https://ip/books/name_of_book/page/create
  3. Browser ends up: http://ip/books/name_of_book/draft/6 (the https is dropped)
Originally created by @mry on GitHub (Jun 10, 2017). ### Setup BookStack (in Docker) behind a reverse proxy (nginx). BookStack service listens on ip:port and reverse proxy exposes ip:443 and proxies https://ip:443 to http://bookstack_ip:port. The App_url is set to the public proxy address: https://ip:443 BookStack v0.16.2 Save Settings ### For Feature Requests Not have URLs hardcoded/saved or logic which are dependant on protocol. ##### Expected Behavior Honor the App_Url if urls are rewritten and/or user redirected ##### Actual Behavior The issues arises in numerous places but for instance Creating a New page results in a url without HTTPS. 1. Initial Page: https://ip/books/name_of_book 2. Click Create, which points to: https://ip/books/name_of_book/page/create 3. Browser ends up: http://ip/books/name_of_book/draft/6 (the https is dropped)
Author
Owner

@mitchray commented on GitHub (Jun 16, 2017):

👍 I think this would also solve the problem of internal links breaking if the hostname changes, due to them being hardcoded also

@mitchray commented on GitHub (Jun 16, 2017): 👍 I think this would also solve the problem of internal links breaking if the hostname changes, due to them being hardcoded also
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2017):

Hi @mry, Sorry but I'm not sure I fully understand and how it would be fixed.

Currently every URL generated within bookstack should go through a single function which will use the set APP_URL (Unless it's left as the default example url). Therefore I'm not really sure why you would have to https dropped in your behaviour.

@ssddanbrown commented on GitHub (Jun 17, 2017): Hi @mry, Sorry but I'm not sure I fully understand and how it would be fixed. Currently every URL generated within bookstack should go through a single function which will use the set APP_URL (Unless it's left as the default example url). Therefore I'm not really sure why you would have to https dropped in your behaviour.
Author
Owner

@mry commented on GitHub (Jun 18, 2017):

I checked my setup and you are right in that my config was wrong. I hadn't set the APP_URL to also include the protocol (https://my.url) and doing so solved my issues.

Thanks for the support.

@mry commented on GitHub (Jun 18, 2017): I checked my setup and you are right in that my config was wrong. I hadn't set the APP_URL to also include the protocol (https://my.url) and doing so solved my issues. Thanks for the support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#357