I have server configured this way:
server {
listen 80 default_server;
listen [::]:80 default_server;
location /health {
auth_basic "Restricted";
auth_basic_user_file "/etc/nginx/.htpasswd";
default_type application/json;
return 200 '{"status":"Ok"}';
}
}
/etc/nginx/.htpasswd exists and contains desired credentials.
Now when I try to access this location it just passes all requests without auth check. E.g.:
ā ~ curl http://localhost:23456/health
{"status":"Ok"}%
Did I miss something?