How to disable this IP/domain redirection? #4360

Closed
opened 2026-02-05 08:39:47 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @cosmicDustOfLightLength on GitHub (Dec 11, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

During installation, we provide the URL or IP, for example 192.168.1.12

Everything was installed correctly, by entering IP 192.168.5.12 in the browser, the page appears and you can log in.

I wanted to enter the domain instead of the IP, e.g. "bookstack.home.lan"

Just like for other such network services on my LAN.
I entered a redirect in my DNS router from "bookstack.home.lan" to IP: 192.168.5.12.

DNS works, but now when you enter the domain "bookstack.home.lan" in the browser, it is automatically redirected to the IP address that was entered during installation.

Can this redirect be disabled somehow?

Due to this redirection from the domain to the IP in the browser, I am not able to configure the zero trust cloudflare tunnel to enter another domain from the public network to the LAN.

It doesn't work because it's a redirect.

While away from home in a public network, entering e.g. "bookstack.tunel.ovh", after authentication, it redirects me to the local IP address which is known only in the LAN network, not WAN.

How to disable this IP/domain redirection so that the browser shows any domain that has been entered for this host's IP address in DNS server. Didn't the browser redirect the address from the domain to the IP entered during installation?

Thanks!

Exact BookStack Version

v23.10.4

Log Content

No response

Hosting Environment

Ubuntu 22.04 Script

Originally created by @cosmicDustOfLightLength on GitHub (Dec 11, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario During installation, we provide the URL or IP, for example 192.168.1.12 Everything was installed correctly, by entering IP 192.168.5.12 in the browser, the page appears and you can log in. I wanted to enter the domain instead of the IP, e.g. "bookstack.home.lan" Just like for other such network services on my LAN. I entered a redirect in my DNS router from "bookstack.home.lan" to IP: 192.168.5.12. DNS works, but now when you enter the domain "bookstack.home.lan" in the browser, it is automatically redirected to the IP address that was entered during installation. Can this redirect be disabled somehow? Due to this redirection from the domain to the IP in the browser, I am not able to configure the zero trust cloudflare tunnel to enter another domain from the public network to the LAN. It doesn't work because it's a redirect. While away from home in a public network, entering e.g. "bookstack.tunel.ovh", after authentication, it redirects me to the local IP address which is known only in the LAN network, not WAN. How to disable this IP/domain redirection so that the browser shows any domain that has been entered for this host's IP address in DNS server. Didn't the browser redirect the address from the domain to the IP entered during installation? Thanks! ### Exact BookStack Version v23.10.4 ### Log Content _No response_ ### Hosting Environment [Ubuntu 22.04 Script](https://www.bookstackapp.com/docs/admin/installation/#ubuntu-2204)
OVERLORD added the 🐕 Support label 2026-02-05 08:39:47 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 11, 2023):

Hi @cosmicDustOfLightLength,
To change the URL after running the script, you need to alter two files:

/var/www/bookstack/.env

Find the APP_URL entry in this file, then update it to be http://bookstack.home.lan (or https if active).

/etc/apache2/sites-available/bookstack.conf

At about line 2 of this file, change the value for ServerName to be bookstack.home.lan instead of your IP. You'll need to restart apache after doing this. sudo systemctl restart apache2.service.


While away from home in a public network, entering e.g. "bookstack.tunel.ovh"

Note that BookStack only supports being hosted on one hostname/domain/origin-name at a time.
Typically, where you may have different public/private addresses, you'd be better off standardising on the externally accessibly address for both, so use the external address for internal use also.

@ssddanbrown commented on GitHub (Dec 11, 2023): Hi @cosmicDustOfLightLength, To change the URL after running the script, you need to alter two files: ### `/var/www/bookstack/.env` Find the `APP_URL` entry in this file, then update it to be `http://bookstack.home.lan` (or https if active). ### `/etc/apache2/sites-available/bookstack.conf` At about line 2 of this file, change the value for `ServerName` to be `bookstack.home.lan` instead of your IP. You'll need to restart apache after doing this. `sudo systemctl restart apache2.service`. --- > While away from home in a public network, entering e.g. "bookstack.tunel.ovh" Note that BookStack only supports being hosted on one hostname/domain/origin-name at a time. Typically, where you may have different public/private addresses, you'd be better off standardising on the externally accessibly address for both, so use the external address for internal use also.
Author
Owner

@Man-in-Black commented on GitHub (Dec 11, 2023):

You should also make use of the following command as described here:
https://www.bookstackapp.com/docs/admin/commands/#update-system-url

This is to alter all exisiting content to the new URL.

@Man-in-Black commented on GitHub (Dec 11, 2023): You should also make use of the following command as described here: https://www.bookstackapp.com/docs/admin/commands/#update-system-url This is to alter all exisiting content to the new URL.
Author
Owner

@cosmicDustOfLightLength commented on GitHub (Dec 12, 2023):

Thanks, all mistake with .env and i put http instead https, now cloudflare tunnel work with this app perfect!

@cosmicDustOfLightLength commented on GitHub (Dec 12, 2023): Thanks, all mistake with .env and i put http instead https, now cloudflare tunnel work with this app perfect!
Author
Owner

@zhudovigor commented on GitHub (Sep 10, 2024):

Hi, I've overwritten everything. the site opens by domain, but there is a split and an error. What can fix it?
image

@zhudovigor commented on GitHub (Sep 10, 2024): Hi, I've overwritten everything. the site opens by domain, but there is a split and an error. What can fix it? ![image](https://github.com/user-attachments/assets/1b5803d1-5220-44ec-9ae9-cae6435cdc73)
Author
Owner

@ssddanbrown commented on GitHub (Sep 10, 2024):

@zhudovigor Start a new support thread, detailing your environment and any information from the application debug logs as per https://www.bookstackapp.com/docs/admin/debugging/#error-log-file.

@ssddanbrown commented on GitHub (Sep 10, 2024): @zhudovigor Start a new support thread, detailing your environment and any information from the application debug logs as per https://www.bookstackapp.com/docs/admin/debugging/#error-log-file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4360