很久以前分享的apche分流方法,大家可以先查看一下
https://x1.php168.com/bbs/show-12545.html
https://x1.php168.com/bbs/show-14735.html
对于NGINX的话,规则如下
if (!-d $request_filename){
set $rule_0 1$rule_0;
}
if (!-f $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)public\/uploads\/(.*)$ https://x1.f2.qibosoft.com/public/uploads/$2 redirect;
}
apche的规则是
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)public\/uploads\/(.*)$ https://x1.f2.qibosoft.com/public/uploads/$2 [R,L]
他们分别都实现同样的功能. 当WEB主服务器附件不存在,就读取备份服务器, 也就是说,你可以定时把主服务器的附件移走. 这里就不涉及到OSS
大家不知道放哪个位置的话,可以参考下面的图片


目前评论:0