◆ 需求:nginx规则,所有对OA.bccom.info的访问,redirect到uc.qycn.com,谢谢。◆ 写法:server{listen 80;server_name uc.qycn.com;index index.htm index.php;root? /export/home/wwwif ($host = “blog.buyinlot.com”){rewrite ^/(.*)$ http://www.buyinlot.com/our-blog/$1 permanent;}}
【符号注释】^ 匹配字符串的开始/ 匹配域名的分隔符. 匹配除换行符以外的任意字符* 重复零次或更多次(.*) 匹配任意字符.* 匹配任意文本$ 匹配字符串的结束
http://blog.csdn.net/xingfujie/article/details/7337832
原创文章,转载请注明: 转载自老实人
本文链接地址: nginx 域名rewrite跳转
文章的脚注信息由WordPress的wp-posturl插件自动生成
以诚感人者,人亦诚而应。