Hi!
I’m trying to protect a folder on my server and have added the following to my server block in my site config:
location ^~ /hiddenfolder/ {
auth_basic "Restricted";
auth_basic_user_file /var/www/mysite.com/.htpasswd;
location ~ \.php {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock; }
}
I have created the .htpasswd file with user and password, so that should work.
I would also like to make sure that this folder is not being cached.
I’m not getting it to work though. This is not part of WordPress, but another folder on my server. Also have cloudflare installed, not sure if that’s a problem?
Thanks!
// Jens.