Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Enable APP_PROXIES Setting in Docker Compose for Nginx Reverse Proxy and BookStack #4936

Open
2 tasks done
Sazzels opened this issue Apr 9, 2024 · 0 comments
Open
2 tasks done

Comments

@Sazzels
Copy link

Sazzels commented Apr 9, 2024

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

When attempting to enable the APP_PROXIES setting in the Docker Compose configuration for Nginx reverse proxy and BookStack, the services fail to function as expected. Despite configuring Nginx as a reverse proxy for BookStack and setting up the necessary environment variables, the interaction between the containers doesn't seem to be established correctly.

Additional Details:

  • Nginx reverse proxy and BookStack are deployed using Docker Compose.
  • The APP_PROXIES setting is enabled in the Docker Compose configuration.
  • Nginx is configured to act as a reverse proxy for BookStack.
  • Both containers are on the same Docker network.
  • Logs from both Nginx and BookStack containers don't provide clear indications of the underlying issue.
  • There are no obvious misconfigurations in the environment variables or configuration files.

I have tried to add all the information about the environment, but can certainly add more if necessary.
Unfortunately, I could not get the real IP within the access logs of bookstack set correctly.

All of the APP_PROXIES comments in the docker-compose.yml below did not work.

Related issue: #2964

Exact BookStack Version

24.02.2

Log Content

log/nginx/access.log
172.25.0.4 - - [09/Apr/2024:20:02:14 +0000] "GET / HTTP/1.1" 200 9278 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0"

docker-compose.yml (Bookstack)

services:
  bookstack:
    image: "linuxserver/bookstack:24.02.2"
    container_name: bookstack
    hostname: docs.<DOMAIN>
    restart: unless-stopped
    networks:
      - proxy
      - docs
    depends_on:
      - bookstack_db
    environment:
      # APP URL
      - APP_URL=https://docs.<DOMAIN>
      # PROXY
      # - APP_PROXIES=*
      # - APP_PROXIES=172.25.0.4
      # - APP_PROXIES=172.25.0.0/16
      # - APP_PROXIES=<PROXY_IP>
      # DATABASE
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=<DB_PASS>
      - DB_DATABASE=bookstack_db
      # SMTP
      - ...
    volumes:
      - "/home/docs/data:/config"
  bookstack_db:
    image: "linuxserver/mariadb:10.11.6"
    container_name: bookstack_db
    hostname: mariadb-bookstack.<DOMAIN>
    restart: unless-stopped
    networks:
      - docs
    environment:
      - MYSQL_ROOT_PASSWORD=<MYSQL_ROOT_PASSWORD>
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstack_db
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=<MYSQL_PASSWORD>
    volumes:
      - "/home/docs/mariadb:/config"
      - "/home/docs/mariadb-dumps:/var/lib/mysql-dumps"

networks:
  docs:
    name: docs
    external: true
  proxy:
    external: true

docker-compose.yml (Proxy)

services:
  proxy:
    image: 'jc21/nginx-proxy-manager:2.11.1'
    container_name: proxy
    hostname: npm.<DOMAIN>
    restart: always
    networks:
      - proxy
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - "/home/proxy/data:/data"
      - "/home/proxy/letsencrypt:/etc/letsencrypt"

networks:
  proxy:
    external: true

Proxy network: 172.25.0.0/16

grafik

Hosting Environment

docker version: 26.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant