songqiulin 當(dāng)前離線
注冊會員
很多朋友問我,為什么他已經(jīng)在apache規(guī)則里面加了禁止別人直接下載.htaccess文件,為什么還是可以下載! 其實這個很簡單,因為.htaccess在lanmp當(dāng)他作為文件被訪問的時候其實是由Nginx來處理的,所以我們需要在Nginx里來添加規(guī)則. 而且這個規(guī)則,在Nginx默認(rèn)的里面是存在的。 # deny access to .htaccess files, if Apache’s document root # concurs with nginx’s one # location ~ /\.ht { deny all; } 復(fù)制到你的nginx/conf/vhost/站點名稱.conf 里,然后service nginxd restart
[我的Linux,讓Linux更易用] ( 粵ICP備12090362號-1)|聯(lián)系我們 |Archiver|WAP
GMT+8, 2025-4-14 23:50, Processed in 0.013375 second(s), 5 queries.
Powered by Discuz! 7.2
© 2001-2009 Comsenz Inc.