Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ param_ports:
# application setup block
app_setup_block_enabled: true
app_setup_block: |
Access the webui at `http://<docker host ip>:80`. For connecting via OPDS on a mobile device use `http://<docker host ip>:80/index.php/feed`. It is strongly suggested that you reverse proxy this prior to exposing to the internet. For more information, such as requiring credentials, check the COPS Wiki (linked above).
Access the webui at `http://<docker host ip>:80`. For connecting via OPDS on a mobile device use `http://<docker host ip>:80/index.php/feed` or `http://<docker host ip>:80/feed`. It is strongly suggested that you reverse proxy this prior to exposing to the internet. For more information, such as requiring credentials, check the COPS Wiki (linked above).

The linuxserver version gives you access to `config/local.php` in `/config` to customise your install to suit your needs, it also includes the dependencies required to directly view epub books in your browser.
# init diagram
Expand Down Expand Up @@ -114,6 +114,8 @@ init_diagram: |
"cops:latest" <- Base Images
# changelog
changelogs:
- {date: "10.06.26:", desc: "Existing users should verify: site-confs/default.conf and config/local.php - Update redirect location and use front controller."}
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
- {date: "08.02.26:", desc: "Adding missing php-tokenizer package."}
- {date: "10.10.25:", desc: "Adding missing icu-data-full package."}
- {date: "10.07.25:", desc: "Rebase to Alpine 3.22."}
Expand Down
13 changes: 9 additions & 4 deletions root/defaults/config/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
*/
$config['cops_x_accel_redirect'] = "X-Accel-Redirect";

/*
* Map /books/ to internal redirect location for COPS 4.2+
*/
$config['cops_x_accel_mapping'] = [
'/books/' => '/_redirect_/',
];

/* Enable cache folder
* especially useful for lower power hosts
*/
Expand Down Expand Up @@ -100,8 +107,6 @@
* - Nginx: nginx.conf
* - PHP built-in: router.php
* - ...
*
* @todo update nginx/site-confs/default.conf.sample to make use of front controller
*/
$config['cops_front_controller'] = '';
//$config['cops_front_controller'] = 'index.php';
//$config['cops_front_controller'] = '';
$config['cops_front_controller'] = 'index.php';
30 changes: 22 additions & 8 deletions root/defaults/nginx/site-confs/default.conf.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Version 2025/07/10 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample
## Version 2026/02/10 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample

server {
listen 80 default_server;
Expand Down Expand Up @@ -31,11 +31,6 @@ server {
expires 31d;
}

location /books {
root /;
internal;
}

location ~ ^(.+\.php)(.*)$ {
# enable the next two lines for http auth
#auth_basic "Restricted";
Expand All @@ -48,8 +43,27 @@ server {
include /etc/nginx/fastcgi_params;
}

# deny access to .htaccess/.htpasswd files
location ~ /\.ht {
# use internal redirect location for X-Accel-Redirect - do not use /books/ or other COPS urls with front controller
location /_redirect_/ {
internal;
alias /books/;
}

# use front controller for COPS 4.2+
location ~ ^/(?!(index\.php|_redirect_)) {
try_files $uri /index.php$request_uri;
}

# deny access to all dotfiles
location ~ /\. {
deny all;
log_not_found off;
access_log off;
return 404;
}

# Allow access to the ".well-known" directory
location ^~ /.well-known {
allow all;
}
}