Update default.conf.sample to deny dotfile access

Signed-off-by: Eric Nemchik <eric@nemchik.com>
This commit is contained in:
Eric Nemchik 2026-02-08 09:39:39 -06:00
parent e4b3d3ccd3
commit 75373e1ae8
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View File

@ -95,6 +95,7 @@ init_diagram: |
"phpmyadmin:latest" <- Base Images
# changelog
changelogs:
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
- {date: "28.12.25:", desc: "Rebase to Alpine 3.23."}
- {date: "23.08.25:", desc: "Add support for mTLS. Existing users will need to delete their config.inc.php and restart the container."}
- {date: "05.07.25:", desc: "Rebase to Alpine 3.22."}

View File

@ -1,4 +1,4 @@
## Version 2024/07/16 - Changelog: https://github.com/linuxserver/docker-phpmyadmin/commits/main/root/defaults/nginx/site-confs/default.conf.sample
## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-phpmyadmin/commits/main/root/defaults/nginx/site-confs/default.conf.sample
map $sent_http_content_type $expires {
default off;
@ -12,6 +12,8 @@ server {
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
listen 443 quic reuseport default_server;
listen [::]:443 quic reuseport default_server;
server_name _;
@ -44,8 +46,16 @@ server {
fastcgi_read_timeout 3600;
}
# 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;
}
}