скрытый файл nginx отклоняет конфигурацию?

Я использую ниже стандартной конфигурации для блокирования загрузки скрытых файлов от nginx:

#Prevent (deny) Access to Hidden Files with Nginx
    location ~ /\. {
            access_log off;
            log_not_found off; 
            deny all;
        }

Но эта конфигурация также блокирует подлинные запросы как:

2013/10/09 17:24:46 [error] 20121#0: *593378 access forbidden by rule, client: XX.55.XXX.201, server: XYZ.org, request: "GET /vip/validate.php?id=dfddfQ&title=.Mytitle HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock", host: "xyz.org"
0
задан 10 October 2013 в 07:46
1 ответ

Вы можете отладить, какое расположение из вашей конфигурации nginx применимо к вашему запросу, добавив «debug» в error.log:

error_log /path-to/error.log debug;

2015/09/24 16:22:12 [debug] 16458#0: *1539 http script copy: "/static.php"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 http script args  
2015/09/24 16:22:12 [debug] 16458#0: *1539 http script copy: "resource="  
2015/09/24 16:22:12 [debug] 16458#0: *1539 http script capture: "frontend/Magento/luma/en_US/mage/calendar.css"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 http script regex end  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: "/"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: "pub"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: "static/"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: "setup"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: ~ "/\."  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: ~ "/media/theme_customization/.*\.xml$"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: ~ "^/errors/.*\.(xml|phtml)$"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: ~ "cron\.php"  
2015/09/24 16:22:12 [debug] 16458#0: *1539 test location: ~ "\.php$"  
**2015/09/24 16:22:12 [debug] 16458#0: *1539 using configuration "\.php$"**  
0
ответ дан 5 December 2019 в 14:50

Теги

Похожие вопросы