504 Gateway Time-out after changing nginx IP #3773

Closed
opened 2026-02-05 07:24:51 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @megatonix on GitHub (May 2, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

After switching nginx serwer IP address i cannot open bookstack domain.

I tried this:

php artisan bookstack:update-url <oldUrl> <newUrl>


even i deleted nginx dir

nothing happend

Exact BookStack Version

23.02.1-ls67

Log Content

No response

PHP Version

7.4

Hosting Environment

Ubuntu server 22.04

Originally created by @megatonix on GitHub (May 2, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario After switching nginx serwer IP address i cannot open bookstack domain. I tried this: ``` php artisan bookstack:update-url <oldUrl> <newUrl> ``` even i deleted nginx dir nothing happend ### Exact BookStack Version 23.02.1-ls67 ### Log Content _No response_ ### PHP Version 7.4 ### Hosting Environment Ubuntu server 22.04
OVERLORD added the 🐕 Support label 2026-02-05 07:24:51 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 2, 2023):

Hi @megatonix,
I'm very confused regarding your environment. The PHP version does not match the BookStack version for the Ubuntu version. Based upon 23.02.1-ls67 it sounds like you might be using the linuxserver docker image? But that's not clear since docker is not otherwise mentioned.

Can you confirm exactly how you installed/run BookStack?

After switching nginx serwer IP address

What exactly do you mean by this, what IP did you change? What Nginx is this? Is that within a container? Or on a host system?

even i deleted nginx dir

Exactly what directory did you delete? Why did you delete this?

@ssddanbrown commented on GitHub (May 2, 2023): Hi @megatonix, I'm very confused regarding your environment. The PHP version does not match the BookStack version for the Ubuntu version. Based upon `23.02.1-ls67` it sounds like you might be using the linuxserver docker image? But that's not clear since docker is not otherwise mentioned. Can you confirm exactly how you installed/run BookStack? > After switching nginx serwer IP address What exactly do you mean by this, what IP did you change? What Nginx is this? Is that within a container? Or on a host system? > even i deleted nginx dir Exactly what directory did you delete? Why did you delete this?
Author
Owner

@megatonix commented on GitHub (May 2, 2023):

Ok so i installed bookstack on 192.168.0.10 but my nginx proxy manager was on 192.168.0.20 now i switch nginx from 192.168.0.20 to 192.169.0.10. After this a cannot load login page.

I Deleted ngix dir in bookstack/nginx then restarted container and nginx dir recreated

@megatonix commented on GitHub (May 2, 2023): Ok so i installed bookstack on 192.168.0.10 but my nginx proxy manager was on 192.168.0.20 now i switch nginx from 192.168.0.20 to 192.169.0.10. After this a cannot load login page. I Deleted ngix dir in bookstack/nginx then restarted container and nginx dir recreated
Author
Owner

@ssddanbrown commented on GitHub (May 2, 2023):

All of this is very environment dependant, and you didn't really answer all questions. It's going to be hard for me to make advisories as I cannot get a clear picture/idea of your environment.

If you are getting a 504 Gateway Time-out, it's likely your config within nginx-proxy-manager is wrong. You'll need to make sure this is forwarding requests to the right IP.

@ssddanbrown commented on GitHub (May 2, 2023): All of this is very environment dependant, and you didn't really answer all questions. It's going to be hard for me to make advisories as I cannot get a clear picture/idea of your environment. If you are getting a `504 Gateway Time-out`, it's likely your config within nginx-proxy-manager is wrong. You'll need to make sure this is forwarding requests to the right IP.
Author
Owner

@megatonix commented on GitHub (May 2, 2023):

What exatly do you need from me and where i can find that?

In my Nginx Proxy manager i point domain to IP addres where i installed Bookstack

@megatonix commented on GitHub (May 2, 2023): What exatly do you need from me and where i can find that? In my Nginx Proxy manager i point domain to IP addres where i installed Bookstack
Author
Owner

@ssddanbrown commented on GitHub (May 3, 2023):

  • Can you still access the nginx proxy-manager interface?
  • Do you host anything else using nginx proxy manager? If so, can you still access those services?
  • Are you using docker-compose? If so, please provide your docker-compose yaml for BookStack.

now i switch nginx from 192.168.0.20 to 192.169.0.10. After this a cannot load login page.

A 192.169.x.x IP address is not within private network space, are you sure that's correct and available on your network?

@ssddanbrown commented on GitHub (May 3, 2023): - Can you still access the nginx proxy-manager interface? - Do you host anything else using nginx proxy manager? If so, can you still access those services? - Are you using docker-compose? If so, please provide your docker-compose yaml for BookStack. > now i switch nginx from 192.168.0.20 to 192.169.0.10. After this a cannot load login page. A `192.169.x.x` IP address is not within private network space, are you sure that's correct and available on your network?
Author
Owner

@megatonix commented on GitHub (May 3, 2023):

It's my mistake. Everything is in 192.168.x.x.

Yes i can still acces nginx proxy-manager interface
Yes everything is working fine on my nginx, like Nextcloud AIO, grafana, UptimeKuma
My docker compose:

version: "3"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=http://book.domain.com
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=
      - DB_DATABASE=bookstackapp
    volumes:
      - ./bookstack:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=
      - TZ=Europe/Poland
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=
    volumes:
      - ./bookstack_db:/config
    restart: unless-stopped

On my router i only switch redirection from nginx on serwer 192.168.10.20 to nginx on serwer 192.168.0.10

@megatonix commented on GitHub (May 3, 2023): It's my mistake. Everything is in 192.168.x.x. Yes i can still acces nginx proxy-manager interface Yes everything is working fine on my nginx, like Nextcloud AIO, grafana, UptimeKuma My docker compose: ``` version: "3" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - APP_URL=http://book.domain.com - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS= - DB_DATABASE=bookstackapp volumes: - ./bookstack:/config ports: - 6875:80 restart: unless-stopped depends_on: - bookstack_db bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD= - TZ=Europe/Poland - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD= volumes: - ./bookstack_db:/config restart: unless-stopped ``` On my router i only switch redirection from nginx on serwer 192.168.10.20 to nginx on serwer 192.168.0.10
Author
Owner

@ssddanbrown commented on GitHub (May 4, 2023):

@megatonix Thanks for the extra info. Could you also provide a screenshot of the proxy host config form for BookStack, within nginx-proxy-manager? You can blank any private domain info, but just want be sure of the config used on that side of things too.

@ssddanbrown commented on GitHub (May 4, 2023): @megatonix Thanks for the extra info. Could you also provide a screenshot of the proxy host config form for BookStack, within nginx-proxy-manager? You can blank any private domain info, but just want be sure of the config used on that side of things too.
Author
Owner

@megatonix commented on GitHub (May 4, 2023):

image

@megatonix commented on GitHub (May 4, 2023): ![image](https://user-images.githubusercontent.com/56199368/236125722-bdcf31cc-5d00-46d5-af0e-b815aa877379.png)
Author
Owner

@ssddanbrown commented on GitHub (May 4, 2023):

Thanks @megatonix, but why hide the "Forward Hostname / IP" field?

From what I can tell, that field has an IP matching 192.168.1xx.xxx, whereas above you have stated the following:

Ok so i installed bookstack on 192.168.0.10

Which does not fit that IP.

Also, just to confirm since it's getting a little confusing, are both nginx and bookstack now on the same host with IP 192.168.0.10? If not, can you confirm what host IP each of these is at.

@ssddanbrown commented on GitHub (May 4, 2023): Thanks @megatonix, but why hide the "Forward Hostname / IP" field? From what I can tell, that field has an IP matching `192.168.1xx.xxx`, whereas above you have stated the following: > Ok so i installed bookstack on 192.168.0.10 Which does not fit that IP. Also, just to confirm since it's getting a little confusing, are both nginx and bookstack now on the same host with IP `192.168.0.10`? If not, can you confirm what host IP each of these is at.
Author
Owner

@megatonix commented on GitHub (May 4, 2023):

Also in Bookstack/logs/nginx/acces.log i found smth like redirecting(?) From old nginx but nothing from new IP address

Screenshot_4

@megatonix commented on GitHub (May 4, 2023): Also in Bookstack/logs/nginx/acces.log i found smth like redirecting(?) From old nginx but nothing from new IP address ![Screenshot_4](https://user-images.githubusercontent.com/56199368/236176800-2adda83c-08a3-49e3-bbb3-0defa2d8d232.png)
Author
Owner

@megatonix commented on GitHub (May 4, 2023):

Yes both bookstack,ngginx,nextcloud is on the same addres IP. I invented these IP addresses so as not to give real data... So don't get confused

@megatonix commented on GitHub (May 4, 2023): Yes both bookstack,ngginx,nextcloud is on the same addres IP. I invented these IP addresses so as not to give real data... So don't get confused
Author
Owner

@megatonix commented on GitHub (May 4, 2023):

I hide forward IP cuz this is my real IP addres. I don't wanna share all private inforamtion to you 😄

@megatonix commented on GitHub (May 4, 2023): I hide forward IP cuz this is my real IP addres. I don't wanna share all private inforamtion to you 😄
Author
Owner

@megatonix commented on GitHub (May 4, 2023):

book

Maybe this help Because u getting confused

@megatonix commented on GitHub (May 4, 2023): ![book](https://user-images.githubusercontent.com/56199368/236180134-905b13d9-0afc-4ae1-a060-01dcf4d800b9.png) Maybe this help Because u getting confused
Author
Owner

@ssddanbrown commented on GitHub (May 4, 2023):

I invented these IP addresses so as not to give real data...

Okay, but IP addresses starting with 192.168. are in the private address space (On your internal network only) so it doesn't provide much privacy/security, really only adds confusion in this case.

Within the "Forward Hostname / IP" for BookStack, you could try using the value host.docker.internal, and if that doesn't work maybe try 172.17.0.1, This is just to be sure it's pointing to the host system port.

@ssddanbrown commented on GitHub (May 4, 2023): > I invented these IP addresses so as not to give real data... Okay, but IP addresses starting with `192.168.` are in the private address space (On your internal network only) so it doesn't provide much privacy/security, really only adds confusion in this case. Within the "Forward Hostname / IP" for BookStack, you could try using the value `host.docker.internal`, and if that doesn't work maybe try `172.17.0.1`, This is just to be sure it's pointing to the host system port.
Author
Owner

@jasonyunliang commented on GitHub (May 9, 2023):

@megatonix , I have a very helpful youtube video to share with. I think it will help understand how we manage Nginx proxy manager.

Securing NGinX Proxy Manager - follow up - securing your admin console for this Open Source
https://www.youtube.com/watch?v=UfCkwlPIozw

@jasonyunliang commented on GitHub (May 9, 2023): @megatonix , I have a very helpful youtube video to share with. I think it will help understand how we manage Nginx proxy manager. Securing NGinX Proxy Manager - follow up - securing your admin console for this Open Source https://www.youtube.com/watch?v=UfCkwlPIozw
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2023):

Since there's been no further follow up from the OP of this issue, I'll go ahead and close this off.

@ssddanbrown commented on GitHub (May 18, 2023): Since there's been no further follow up from the OP of this issue, I'll go ahead and close this off.
Author
Owner

@megatonix commented on GitHub (May 18, 2023):

To add an answer, i wait like 3 days and bookstack start working normally. Idk what happend for real

@megatonix commented on GitHub (May 18, 2023): To add an answer, i wait like 3 days and bookstack start working normally. Idk what happend for real
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3773