Auth basic and fast cgi rules with request matched by location

tom wang tomawng at yahoo.fr
Mon Jul 30 20:16:37 MSD 2007


Hi,

Is there a way for a request to match more than one
location statement? 

To be more clear, I have the following configuration
file:

 server {
   # port to listen on. Can also be set to an IP:PORT
   listen       80;

   # sets the domain[s] that this vhost server
requests for
   #server_name  example.com www.example.com;
   server_name  blah.jp www.blah.jp;

   # vhost specific access log
   access_log      /var/log/nginx/blah.access_log
main;
   error_log       /var/log/nginx/blah.error_log info;



   root /site/www;
   index  index.html index.htm index.cgi;

   location ~* .cgi$ {
     satisfy_any on;
     include /usr/local/nginx/conf/perl.conf;

   }

  location ~ ^/schedule {
      auth_basic            "Restricted";
      auth_basic_user_file 
/site/htpasswd/schedule/passwd;
   }

   location ~ ^/doumei {
      auth_basic            "Restricted";
      auth_basic_user_file 
/site/htpasswd/doumei/passwd;
   }

   error_page   500 502 503 504  /50x.html;
   location = /50x.html {
     root   html;
   }
}


Is it possible for one request (for example
/doumei/add.cgi) to match both the cgi directive and
the basic authentification rules described in location
~ ^/doumei ? 
I have a lot of cgi script that need to be protected
by basic authentification and I'm trying to find the
best way to configure this.


Thanks



      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 





More information about the nginx mailing list