#匹配所有的txt|xml
location ~^/.*.(txt|xml)$ {
    # 根目录所有的txt 文件请求 转发到 http://yourdomain.com/aa/bb?file=$1 位置
    rewrite ^/(.).(txt|xml) /aa/bb?file=$1 break;
    proxy_pass  http://yourdomain.com;
}