diff --git a/readme-vars.yml b/readme-vars.yml index 8d1122f..41ef22d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -70,6 +70,7 @@ app_setup_block: | # changelog changelogs: + - { date: "07.05.24:", desc: "Existing users should verify: site-confs/default.conf - Fix rewriting rules default site conf." } - { date: "20.03.24:", desc: "Rebase to Alpine 3.19." } - { date: "25.12.23:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf." } - { date: "11.08.23:", desc: "Undeprecate and add new branch with mikespub fork which is actively maintained." } diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 03e5f5b..03f256f 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,4 +1,4 @@ -## Version 2023/12/25 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample +## Version 2024/05/07 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample server { listen 80 default_server; @@ -14,13 +14,23 @@ server { root /app/www/public; index index.html index.htm index.php; - #Useful only for Kobo reader - location /cops/ { + #URL rewriting with COPS - see https://github.com/seblucas/cops/wiki/Url-Rewriting-with-COPS + location /download/ { + rewrite ^/download/(\d+)/(\d+)/.*\.kepub\.epub$ /fetch.php?data=$1&db=$2&type=epub last; rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last; + rewrite ^/download/(\d+)/.*\.kepub\.epub$ /fetch.php?data=$1&type=epub last; rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last; break; } + location /view/ { + rewrite ^/view/(\d+)/(\d+)/.*\.kepub\.epub$ /fetch.php?data=$1&db=$2&type=epub&view=1 last; + rewrite ^/view/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3&view=1 last; + rewrite ^/view/(\d+)/.*\.kepub\.epub$ /fetch.php?data=$1&type=epub&view=1 last; + rewrite ^/view/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2&view=1 last; + break; + } + #Can break loading the images - if you don't see anything, comment location ~ ^/images.*\.(gif|png|ico|jpg)$ { expires 31d;