Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /www/wwwroot/blog_qqvbc_com/usr/plugins/Access/Access_Core.php on line 339

Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /www/wwwroot/blog_qqvbc_com/usr/plugins/Access/Access_Core.php on line 392

Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /www/wwwroot/blog_qqvbc_com/usr/plugins/Access/Access_Core.php on line 394
nginx配置实现非www跳www域名,移动端跳m移动端域名的方法 - Joyber 的博客

注意:nginx配置不支持 if ( && ) 以及 if 嵌套写法

if ($host = 'xxxx.com' ) {
  rewrite ^ https://www.xxxx.com$uri permanent;
}
set $flag "0";
if ($host = 'www.xxxx.com') {
  set $flag "${flag}1";
}
if ( $http_user_agent ~* "(Android|webOS|iPhone|iPad|BlackBerry)" ){
  set $flag "${flag}1";
}
 
if ($flag = "011"){
    rewrite ^/(.*)$ https://m.xxxx.com$uri permanent;
}

标签: none

添加新评论