I'm trying to put an htpasswd only for a group of sub-pages under this url:
https://exemple.com/doku.php?id=staff
So for instance this page should be include:
https://exemple.com/doku.php?id=staff:modo
I tried to do this in nginx:
location ~ ^/doku.php?id=staff(.*) {
auth_basic "Staff only";
auth_basic_user_file /etc/nginx/.htpasswd/.htpasswd-staff;
}
But there no action, even on the main page exemple.com/doku.php?id=staff
I tried also this:
location ~ ^/doku.php(.*) {
if ( $query_string = "id=staff" ) {
auth_basic "Staff only";
auth_basic_user_file /etc/nginx/.htpasswd/.htpasswd-staff;
}
}
But can't reload nginx with error:
nginx: [emerg] "auth_basic" directive is not allowed here in /etc/nginx/conf.d/site.conf:31
What did I miss ?