nginx 泛域名解析 (4588人路过)

18:38 , 引用(0) Via 本站原创

在dns做一条泛指到主机上,利用nginx做二级域名的rewirte

例如music.abc.com/index.php?id=1转到www.abc.com/music/index.php?id=1

引用
server {
listen 80;

server_name www.abc.com;

access_log off;

root /usr/www/abc/;

location / {

index index.php index.html index.htm;

}

}

server {

server_name ~^(.*)\.abc\.com$;

set $name $1;

rewrite ^ http://www.abc.com/$name$request_uri ;

}

作者:77run@齐齐奔跑 -- 骑士威科技
地址:http://blog.77run.com/nginx-rewrite-dns/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: 77run 编辑于2011/09/15 23:46
| |
0 Responses to "A Sample Post with Links"
发表评论
  • 昵称 [注册]
  • 密码 游客无需密码
  • 网址
  • 电邮
打开HTML 打开UBB 打开表情 隐藏 记住我