使用规则引擎
其中一个配置了很多浏览器,另外一个配置匹配所有 ,这样就能正常访问。如果这两个网站,有一个没有使用规则引擎,那么就会两个网站都匹配上,然后第四条规则目标path和第一条的会拼接起来作为oss的key,肯定不存在,所以会访问不了页面
规则这里,可以并且 或
上面对比实现的nginx配置
if ($http_user_agent ~* "GoBrowser|MIDP|WAP|UP\.Browser|Obigo|Mobile|mobile|AU\.Browser|wxd\.Mms|WxdB\.Browser|CLDC|UP\.Link|KM\.Browser|UCWEB|SEMC-Browser|Mini|Symbian|Palm|Nokia|Panasonic|MOT-|SonyEricsson|NEC-|Alcatel|Ericsson|BENQ|BenQ|Amoisonic|Amoi|Capitel|PHILIPS|SAMSUNG|Lenovo|Mitsu|Motorola|SHARP|WAPPER|LG-|LG/|EG900|CECT|Compal|kejian|Bird|BIRD|G900/V1\.0|Arima|CTL|TDG|Daxian|DBTEL|Eastcom|EASTCOM|PANTECH|Dopod|Haier|HAIER|KONKA|KEJIAN|LENOVO|Soutec|SOUTEC|SAGEM|SEC|SED-|EMOL|INNO55|ZTE|Phone|phone|Android|WindowssCE|DX|TELSON|TCL|oppo|ChangHong|MALATA|TIANYU|MAUI|J2ME|BlackBerry|yulong|NOKIA|UNTRUSTED|SCH-|LGE-|CTC/1|kyocera|CEC-|DAXIAN|Sanyo-|Openwave|htc|Maemo|maemo|Mobi") {rewrite ^/(.*).(svg|tif|tiff|wbmp|png|bmp|fax|gif|ico|jfif|jpe|jpeg|jpg|woff|cur|webp|swf|ttf|eot|woff2|css|js|txt|json|xhtml|html|map|rplib)$ /xx/firefxx-overseas/$1.$2 last;rewrite ^/(.*)/? /xxx/firexx-overseas/index.html last;}if ($http_user_agent ~* ".*") {rewrite ^/(.*).(svg|tif|tiff|wbmp|png|bmp|fax|gif|ico|jfif|jpe|jpeg|jpg|woff|cur|webp|swf|ttf|eot|woff2|css|js|txt|json|xhtml|html|map|rplib)$ /xx/yhxs/$1.$2 last;rewrite ^/(.*)/? /xx/yhxs/index.html last;}location / {if ($request_method = POST){return 403;}if ($request_method = PUT){return 403;}if ($request_method = DELETE){return 403;}proxy_set_header Host minio-xx.xx.com;proxy_pass http://minio-xx-nginx; }