首页 > nginx的文件转向问题

nginx的文件转向问题

原来的地址是http://aaa.com/aaa.swf

新地址是http://bbb.com/bbb(没有.swf,程序自动加载的)

这种情况怎么实现访问源地址也能自动加载新地址(不是跳转)


如果不在同一台主机上,可以通过反向代理来实现

bbb.comserver {}块中加入如下语句即可。

location / { 
    if ($uri = /bbb)
    {   
        rewrite ^/bbb$ /aaa.swf break;
        proxy_pass http://aaa.com;
    }   
}   

location ~ ^/aaa.swf {
    root /var/www/bbb.com # the local file path of bbb
    # use rewrite to map aaa.swf to bbb
}
【热门文章】
【热门文章】