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.

2 Answers 2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .