Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: - ngx_http_auth_basi c_module




       ,    
. -  ...



        location / {

            root   /home/egor/html/site.com;
            index  index.php index.html index.htm;
            error_page 404 = /index.php;
        }

        location /admin/ {
            root   /home/egor/html/site.com;
            auth_basic            "closed site";
            auth_basic_user_file  /home/egor/pass;
        }


O>    ,       
O>         .

O>          /admin/     IP - 
, 
O>     ,    @backend      
O>    ...    .

O>        -    NGINX

O>   .
O>   
O>     :

O>   

O>   
O>        location / {
O>             root  /home/egor/html/site.com;
O>             index index.php;

O>             error_page 404   /404.html;

O>         }
O>         


O>          error_page  503             /503.html;
O>          error_page 403 500 502 504  /;



O>       location ~ /admin/ {

O>               satisfy  any;

O>               allow  192.168.1.1;
O>               deny   all;       
O>                 
O>               auth_basic            "Warning! Closed area!";
O>               auth_basic_user_file  /home/egor/pass;

O>               error_page 404 = @backend;
O>               
O>             }


O>       location  ~ /download/ {
O>   
O>                deny    all;
O>                
O>                }
O>                            

O>       location ~ /admin/htmlarea/ {
O>   
O>                deny    all;
O>                
O>        }



O>         # pass the PHP scripts to FastCGI server
O>         location ~ \.php$ {

O>              fastcgi_pass   unix:/tmp/php.sock;
O>              fastcgi_index  index.php;

O>              fastcgi_param  SCRIPT_FILENAME 
O> /home/egor/html/site.com$fastcgi_script_name;
O>              fastcgi_param  QUERY_STRING     $query_string;
O>              fastcgi_param  REQUEST_METHOD   $request_method;
O>              fastcgi_param  CONTENT_TYPE     $content_type;
O>              fastcgi_param  CONTENT_LENGTH   $content_length;

O>              fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
O>              fastcgi_param  REMOTE_ADDR      $remote_addr;
O>              
O>              fastcgi_param  DOCUMENT_ROOT   "/home/egor/html/site.com/";
O>         }

O>         
O>         location @backend {

O>              root           /home/egor/html/site.com;
O>              fastcgi_pass   unix:/tmp/php.sock;
O>              fastcgi_index  index.php;
O>              fastcgi_param  SCRIPT_FILENAME 
O> /home/egor/html/site.com$fastcgi_script_name;
O>              fastcgi_param  QUERY_STRING     $query_string;
O>              fastcgi_param  REQUEST_METHOD   $request_method;
O>              fastcgi_param  CONTENT_TYPE     $content_type;
O>              fastcgi_param  CONTENT_LENGTH   $content_length;

O>              fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
O>              fastcgi_param  REMOTE_ADDR      $remote_addr;

O>              include        fastcgi_params;

O>          }

O>         # deny access to .htaccess files, if Apache's document root
O>         # concurs with nginx's one
O>         #
O>         location ~ /\.ht {
O>             deny  all;
O>         }




 




Copyright © Lexa Software, 1996-2009.