auth_basic restricted files with php

clinisbud nginx-forum at nginx.us
Tue Apr 13 10:40:55 MSD 2010


Hi,

finally, I've solved it.

server {

listen          80;
server_name myserver.es;

 location ~*/apc {
      #root /usr/local/nginx/htdocs;      
       	auth_basic  "Restricted";
            auth_basic_user_file  /usr/local/nginx/htdocs/.htpasswd;
 location ~\.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/htdocs$fastcgi_script_name;
            include        /usr/local/nginx/conf/fastcgi_params;
        }
        }
location ~\.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/htdocs$fastcgi_script_name;
            include        /usr/local/nginx/conf/fastcgi_params;
        }
}

Solution posted.

Thank you

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,74117,74401#msg-74401




More information about the nginx mailing list