[Support Request]: Documentation-Enhancement Deploying with internal URL but also serve via Apache-Proxy with external URL. #2499

Closed
opened 2026-02-05 04:20:36 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @crpb on GitHub (Nov 21, 2021).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

First of all. I didn't really know which type of ticket would be best so please be gentle :-).

I just got this working and wanted to share it for those who are also deploying the Bookstack-App in an local Domain-Environment but also want to access it via e.g. WAN.

With Apache mod_proxy and mod_substitute i used the following Configuration

Apache WAN

<Location "/wiki">
    RewriteEngine on
    RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}] # note mod_rewrite's lookahead option
    RequestHeader set Proxy-User %{PROXY_USER}e
    ProxyPreserveHost off
    SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE 
    AddOutputFilterByType SUBSTITUTE text/html
    AddOutputFilterByType SUBSTITUTE text/css
    AddOutputFilterByType SUBSTITUTE text/javascript
    AddOutputFilterByType SUBSTITUTE application/javascript
    AddOutputFilterByType SUBSTITUTE application/x-javascript
    Substitute "s/local.hostname.tld/external.hostname.tld/iq"
        ProxyPass https://local.hostname.tld/wiki
        ProxyPassReverse https://local.hostname.tld/wiki
</Location>

I left the Proxy-User as it suits my setup with SSO. (No, not SSO in Bookstack but all other Sites)

Apache INTERNAL

ProxyPreserveHost on
ProxyPass /wiki http://localhost:40280
ProxyPassReverse /wiki http://localhost:40280

<Location /wiki/api>
#This one is from allowing API-Access without SSO-Auth as the API uses the Token
Order allow,deny
allow from all
</Location>

Maybe there is something that can be done better. All tests I've done so far worked.

regards,
~crpb

Exact BookStack Version

v21.11

Log Content

No response

PHP Version

No response

Hosting Environment

Bookstack-App:
docker-compose
image: ghcr.io/linuxserver/bookstack:version-v21.11
Bookstack-Host:
Ubuntu 18.04
Apache 2.4.29 with Kerberos-SSO
WAN-Host:
Ubuntu 18.04
Apache 2.4.29

Originally created by @crpb on GitHub (Nov 21, 2021). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario First of all. I didn't really know which type of ticket would be best so please be gentle :-). I just got this working and wanted to share it for those who are also deploying the Bookstack-App in an local Domain-Environment but also want to access it via e.g. WAN. With Apache [mod_proxy](http://httpd.apache.org/docs/2.4/mod/mod_proxy.html) and [mod_substitute](http://httpd.apache.org/docs/2.4/mod/mod_substitute.html) i used the following Configuration > Apache WAN ``` <Location "/wiki"> RewriteEngine on RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}] # note mod_rewrite's lookahead option RequestHeader set Proxy-User %{PROXY_USER}e ProxyPreserveHost off SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE AddOutputFilterByType SUBSTITUTE text/html AddOutputFilterByType SUBSTITUTE text/css AddOutputFilterByType SUBSTITUTE text/javascript AddOutputFilterByType SUBSTITUTE application/javascript AddOutputFilterByType SUBSTITUTE application/x-javascript Substitute "s/local.hostname.tld/external.hostname.tld/iq" ProxyPass https://local.hostname.tld/wiki ProxyPassReverse https://local.hostname.tld/wiki </Location> ``` I left the Proxy-User as it suits my setup with SSO. (No, not SSO in Bookstack but all other Sites) > Apache INTERNAL ``` ProxyPreserveHost on ProxyPass /wiki http://localhost:40280 ProxyPassReverse /wiki http://localhost:40280 <Location /wiki/api> #This one is from allowing API-Access without SSO-Auth as the API uses the Token Order allow,deny allow from all </Location> ``` Maybe there is something that can be done better. All tests I've done so far worked. regards, ~crpb ### Exact BookStack Version v21.11 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Bookstack-App: docker-compose image: ghcr.io/linuxserver/bookstack:version-v21.11 Bookstack-Host: Ubuntu 18.04 Apache 2.4.29 with Kerberos-SSO WAN-Host: Ubuntu 18.04 Apache 2.4.29
OVERLORD added the 🐕 Support label 2026-02-05 04:20:36 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 21, 2021):

Thanks for sharing @crpb.
Since there's no action to perform here I'll close this off but hopefully it'll remain useful to anyone searching when in a similar scenario.

Just to confirm, BookStack only supports being accessed via a single host URL (or APP_URL value). Performing edit activities via mulitple URLs could lead to issues depending on a bunch of factors.

@ssddanbrown commented on GitHub (Nov 21, 2021): Thanks for sharing @crpb. Since there's no action to perform here I'll close this off but hopefully it'll remain useful to anyone searching when in a similar scenario. Just to confirm, BookStack only supports being accessed via a single host URL (or `APP_URL` value). Performing edit activities via mulitple URLs could lead to issues depending on a bunch of factors.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2499