I have setup my Nginx server to have authentication for everything, but I want to exclude all the files under /var/www/html/t/sms/plivo
for password authentication. I have tried using different paths but it always asks for a password when I try to access a file under /var/www/html/t/sms/plivo
from my browser.
Below is my /etc/nginx/sites-available/default
file
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
auth_basic "Private Property";
auth_basic_user_file /etc/nginx/.htpasswd;
#no password for the plivo folder so we can recieve messages!
location = /t/sms/plivo/ {
auth_basic off;
allow all; # Allow all to see content
}
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}