I have the following
location /admin {
auth_pam "Secure Zone";
auth_pam_service_name "nginx";
if (-f $request_filename) {
expires max;
break;
}
if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") {
rewrite ^(.*) /admin.php last;
}
}
If I comment out the rewrite I get the htpasswd box.. with it in there I ignores it completely. I need all my /admin/* urls to get the admin.php script and that script handles the routes.