基于User-Agent控制

location / {
if ($http_user_agent ~* "(mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)") {
add_header X-Frame-Options SAMEORIGIN;
proxy_pass 手机端uri;
}
}

根据location+User_agent控制

 

server{
listen 4104;
server_name localhost;

location /h5/ {
if ($http_user_agent ~* "(mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)") {
add_header X-Frame-Options SAMEORIGIN;
proxy_pass http://10.24.61.41:4100;
}
}
location /gmtlogin {
proxy_pass http://10.24.61.41:4100;
}
location ^~ / {
deny all;
}
}

 

相关文章:

  • 2022-12-23
  • 2021-08-20
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2021-11-20
猜你喜欢
  • 2022-01-08
  • 2022-12-23
  • 2021-07-12
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
相关资源
相似解决方案