Location recursive downloads php files

Peleke nginx-forum at nginx.us
Sat Jul 20 21:01:39 UTC 2013


I try to secure a specific folder and all files and subfolders with this
location block:

    location ^~ /folder1/admin {
        auth_basic  "Login";
        auth_basic_user_file 
/var/www/domain.tld/www/folder1/admin/.htpasswd;
    }

With this code nginx offers always to download the php files.

With this code everything works as expected except that files and subfolders
are not secured:

    location /folder1/admin {
        auth_basic  "Login";
        auth_basic_user_file 
/var/www/domain.tld/www/folder1/admin/.htpasswd;
    }

Why is that and how can I fix the problem from the first block?

Thanks.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,241080,241080#msg-241080



More information about the nginx mailing list