server

{

    listen 80;

    server_name www.test1.com www.aaa1.com www.bbb1.com;

    if ($host != 'www.test1.com')

      {

   rewrite ^/(.*)$ http://www.test1.com/$1 permanent;

     }

    index index.html index.htm index.php;

    root /data/www;

     access_log /tmp/access.log 123456;

    location ~ .*admin\.php$ {

       auth_basic "123123 auth";

      auth_basic_user_file /usr/local/nginx/conf/.htpasswd;

 include fastcgi_params;

        fastcgi_pass unix:/tmp/www.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;

}

   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$

       {

    access_log off;

    }

   location ~ .*\.(static|cache)$

       {

    access_log off;

    }

    location ~ \.php$ {

        include fastcgi_params;

        fastcgi_pass unix:/tmp/www.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;

    }


}