linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
747 stars 108 forks source link

APP_URL is not work #127

Closed k19810703 closed 2 years ago

k19810703 commented 2 years ago

I set APP_URL=http://mydomain/wiki

but bookstack is not work on http://mydomain/wiki.

Does sub path not supported?

docker-compose.yml

---
  version: "2"
  services:
    bookstack:
      image: lscr.io/linuxserver/bookstack
      container_name: bookstack
      environment:
        - PUID=1000
        - PGID=1000
        - APP_URL=http://mydomain/wiki
        - DB_HOST=bookstack_db
        - DB_USER=bookstack
        - DB_PASS=mypass
        - DB_DATABASE=bookstackapp
      volumes:
        - ./data:/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=mypass
        - TZ=Europe/London
        - MYSQL_DATABASE=bookstackapp
        - MYSQL_USER=bookstack
        - MYSQL_PASSWORD=mypass
      volumes:
        - ./data:/config
      restart: unless-stopped

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
New container detected. Setting up app folder and fixing permissions.
App Key found - setting variable for seds
Running config - db_user set
**** APP_URL in /config/www/.env is being updated from http://101.231.172.204:6875 to http://mydomain/wiki ****
**** If this is an existing install, you should run the following line from your host terminal to update the database URL entries: ****
************************************************************************
docker exec -it bookstack php /var/www/html/artisan bookstack:update-url http://101.231.172.204:6875 http://mydomain/wiki
************************************************************************
/var/run/s6/etc/cont-init.d/50-config: line 97: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 97: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

ssddanbrown commented 2 years ago

Sub-path usage won't be achieved via APP_URL alone. Ideally you'd need to handle the sub-path component, and handle the URL, on whatever original system receives requests to mydomain. If using nginx this might look something like this:

location /wiki/ {
  proxy_pass http://bookstack-host:6875/;
  proxy_redirect off;
}
k19810703 commented 2 years ago

I am using Kong as reverse proxy. Proxy /wiki to http://bookstack-host:6875/.

But http://mydomain/wiki doesn't show the login page.