From 571a87d98edc590dbf4f2f267148bc5549a09953 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 8 Feb 2026 09:39:33 -0600 Subject: [PATCH] Update default.conf.sample to deny dotfile access Signed-off-by: Eric Nemchik --- readme-vars.yml | 1 + .../nginx/site-confs/default.conf.sample | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/readme-vars.yml b/readme-vars.yml index 841a002..1912a74 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -89,6 +89,7 @@ init_diagram: | "your_spotify:latest" <- Base Images # changelog changelogs: + - {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."} - {date: "09.07.25:", desc: "Rebase to Alpine 3.22."} - {date: "20.12.24:", desc: "Rebase to Alpine 3.21."} - {date: "27.05.24:", desc: "Existing users should update their nginx confs to avoid http2 deprecation warnings."} diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 85632e3..b6a178c 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,4 +1,4 @@ -## Version 2025/07/09 - Changelog: https://github.com/linuxserver/docker-your_spotify/commits/main/root/defaults/nginx/site-confs/default.conf.sample +## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-your_spotify/commits/main/root/defaults/nginx/site-confs/default.conf.sample server { listen 80 default_server; @@ -24,13 +24,21 @@ server { } location /api/ { - rewrite /foo/(.*) /$1 break; + rewrite /foo/(.*) /$1 break; proxy_set_header Upgrade $http_upgrade; proxy_pass http://localhost:8080/; } - # deny access to .htaccess/.htpasswd files - location ~ /\.ht { + # 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; } }