nginx域名跳转

编辑配置文件,修改为:

server
{
listen 80;
server_name www.test.com www.aaa.com www.bbb.com;
if ($host != ‘www.test.com')
{
rewrite ^/(.)$ http://www.test.com/$1 permanent;
}
index index.html index.htm index.php;
root /data/www;
location ~ .
admin.php$ {
auth_basic “grapedlinux 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;
}