Почему Nginx не видет файл в скрытой папке?

Собственно очень странная ситуация.
/bitrix/themes/.default/11.txt - отдает 403 ошибку.
при этом
/bitrix/themes/default/11.txt - 200
Конфиг самый простой по факту просто FPM подключен

Логи ошибки

95.216.243.254 - - [07/Jun/2022:11:02:22 +0300] "GET /bitrix/themes/.default/11.txt HTTP/1.1" 403 134 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.

2022/06/07 11:03:02 [error] 1352453#1352453: *6583 access forbidden by rule, client: 95.216.243.254, server: acs.subaru-conf.ru, request: "GET /bitrix/themes/.default/11.txt HTTP/1.1", host: "acs.subaru-conf.ru"

Юзеры и группы везде одинаковые прав на все хватает.
Конфги.

server {
        listen *:80;
        listen [::]:80;
        listen *:443 ssl http2;

        ssl_protocols TLSv1.3 TLSv1.2;
        listen [::]:443 ssl http2;
        ssl_certificate /var/www/clients/client1/web1/ssl/acs.subaru-conf.ru-le.crt;
        ssl_certificate_key /var/www/clients/client1/web1/ssl/acs.subaru-conf.ru-le.key;
        server_name acs.subaru-conf.ru www.acs.subaru-conf.ru;
        root   /var/www/acs.subaru-conf.ru/web/;
        index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;
        error_log /var/log/ispconfig/httpd/acs.subaru-conf.ru/error.log;
        access_log /var/log/ispconfig/httpd/acs.subaru-conf.ru/access.log combined;

        location ~ /\. {
                        deny all;
        }

        location ^~ /.well-known/acme-challenge/ {
                        access_log off;
                        log_not_found off;
                        auth_basic off;
                        root /usr/local/ispconfig/interface/acme/;
                        autoindex off;
                        index index.html;
                        try_files $uri $uri/ =404;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
            expires max;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats/ {

            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web1/web//stats/.htpasswd_stats;
            add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;";
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            try_files /2c0289450b736c048b199338a3275cd1.htm @php;
        }

        location @php {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php7.4-fpm/web1.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }
        try_files $uri $uri/ /bitrix/urlrewrite.php$is_args$args;
        
}
  • Вопрос задан
  • 171 просмотр
Решения вопроса 1
@dodo512
location ~ /\. {
                deny all;
}

Шаблон /\. ловит любые адреса где после слэша идёт точка.
https://regex101.com/r/z4phhw/1
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы