• Nginx配置同域名下PC端与移动端访问拦截


    基于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;
    }
    }
  • 相关阅读:
    oracle-PL/SQL1
    ROS之Gazebo
    ROS之urdf 2
    ROS之urdf 1
    ROS 面部识别
    ROS x Arduino
    STM32F0的低功耗模式
    项目进度
    C++函数返回为引用
    STM32F0的多路ADC 无DMA
  • 原文地址:https://www.cnblogs.com/cpw6/p/14519450.html
Copyright © 2020-2023  润新知