码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx配置根据客户端设备转发

时间:2018-07-05 14:56:30      阅读:512      评论:0      收藏:0      [点我收藏+]

标签:ror   html   设备   nginx配置   color   event   cti   苹果   roi   

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  $remote_addr - $remote_user [$time_local] "$request" 
                      $status $body_bytes_sent "$http_referer" 
                      "$http_user_agent" "$http_x_forwarded_for";

    access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    upstream static_pools {
        server 192.168.56.13;

        }
    upstream  upload_pools {
        server 192.168.56.14;

        }
    #gzip  on;

    server {
        listen       80;
        server_name  localhost;
        root /Data/www;

        location / {
                if ($http_user_agent ~* "MSIE") {
                        proxy_pass http://static_pools;
                                }
                if ($http_user_agent ~* "chrome") {
                        proxy_pass http://upload_pools;
                                        }
#               if ($http_user_agent ~* "Firefox") {
#                       proxy_pass http://xxx_pools;
#                               }
#安卓:android 苹果:iphone
           index index.html; } error_page
500 502 503 504 /50x.html; location = /50x.html { root html; } } }

 

Nginx配置根据客户端设备转发

标签:ror   html   设备   nginx配置   color   event   cti   苹果   roi   

原文地址:https://www.cnblogs.com/Template/p/9267931.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!