set $mobile_request '0';

if ($http_user_agent ~* (Android|webOS|iPhone|iPod|BlackBerry)) {

set $mobile_request '1';
    }


if ( $request_uri ~* (error)) {

set $mobile_request '2';
    }

if ($mobile_request = '0') {
rewrite ^.+ http://www.baidu.com/error.html;
}

nginx只允许移动端访问( 判断拦截pc浏览器访问)

相关文章:

  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-15
  • 2021-04-22
  • 2021-08-04
相关资源
相似解决方案