0

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.

1
    location /admin { 
           auth_pam "Secure Zone"; 
           auth_pam_service_name "nginx"; 
           try_files $uri $uri/ /admin.php; 


    location ~* \\.(js|htc|ico|gif|jpg|png|css)$ { 
          access_log off; 
          expires max; 
    } 

}
1

BROKEN!!! http://wiki.nginx.org/IfIsEvil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.