linuxserver / docker-dokuwiki

GNU General Public License v3.0
113 stars 24 forks source link

APP_URL environment variable not working #19

Closed sargreal closed 4 years ago

sargreal commented 4 years ago

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Setting the environment variable APP_URL should change the root of dokuwiki to the parameter.

Current Behavior

There is no difference. This is because the functionality was removed in #3 without updating the documentation.

Steps to Reproduce

  1. Create a container with the example command
    docker create \
      --name=dokuwiki \
      -e PUID=1000 \
      -e PGID=1000 \
      -e TZ=Europe/London \
      -e APP_URL=/dokuwiki `#optional` \
      -p 80:80 \
      -p 443:443 `#optional` \
      -v </path/to/appdata/config>:/config \
      --restart unless-stopped \
      linuxserver/dokuwiki
  2. Run the container with docker start dokuwiki
  3. Access http://localhost/dokuwiki in browser
  4. See that it is the dokuwiki page and not the start page

Environment

OS: Debian Stretch CPU architecture: x86_64
How docker service was installed: apt-get

Command used to create docker container (run/create/compose/screenshot)

See above

Docker logs

not really relevant stuff there

github-actions[bot] commented 4 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

sargreal commented 4 years ago

For reference I got dokuwiki working under the path /wiki with the following config (adapted from https://forum.dokuwiki.org/d/17126-installing-on-nginx-in-a-subdirectory):

server {
    listen 80 default_server;

    listen 443 ssl;

    server_name _;

    ssl_certificate /config/keys/cert.crt;
    ssl_certificate_key /config/keys/cert.key;

    # Maximum file upload size is 4MB - change accordingly if needed
    client_max_body_size 4M;
    client_body_buffer_size 128k;

    root /app/dokuwiki;
    index doku.php;

    #Remember to comment the below out when you're installing, and uncomment it when done.
    location ~ /(conf/|bin/|inc/|install.php) { deny all; }

    #Support for X-Accel-Redirect
    location ~ /data/ { internal ; }

    location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$ {
        expires 365d;
    }

    location / { try_files $uri $uri/ @dokuwiki; }

    location /wiki {
      alias /app/dokuwiki;

      try_files $uri $uri/ @dokuwiki;

      #Remember to comment the below out when you're installing, and uncomment it when done.
      location ~ /(conf/|bin/|inc/|install.php) { deny all; }                               

      #Support for X-Accel-Redirect                                                         
      location ~ /data/ { internal ; }

      location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index  index.php;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
      }
    }

    location @dokuwiki {
        # rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page
        rewrite ^/wiki/_media/(.*) /wiki/lib/exe/fetch.php?media=$1 last;
        rewrite ^/wiki/_detail/(.*) /wiki/lib/exe/detail.php?media=$1 last;
        rewrite ^/wiki/_export/([^/]+)/(.*) /wiki/doku.php?do=export_$1&id=$2 last;
        rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;                                                     
        rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;        
        rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
        rewrite ^/wiki/(.*) /wiki/doku.php?id=$1&$args last;
        rewrite ^/(.*) /doku.php?id=$1&$args last;
    }

    location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # With php5-cgi alone:
                fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include /etc/nginx/fastcgi_params;
    }
}