首页 > 代码库 > nginx 灰度配置文件

nginx 灰度配置文件

 server {
        listen       80;
        server_name  i.shequbanjing.com 172.16.201.1;

        charset UTF-8;

        access_log  logs/i.shequbanjing.com.access.log  main;
        error_log  logs/i.shequbanjing.com.error.log  warn;


        location /business/api {
                if ( $http_x_forwarded_for ~ 106.14.94.192,61.50.105.10 ) {
                        rewrite ^/business/(.*)$ /$1 break;
                        proxy_pass http://pool_businessapi.sqbj.com_tomcat_hd;
                }
            proxy_pass http://pool_businessapi.sqbj.com_tomcat/api;
        }

        location /common/api {
                if ( $http_x_forwarded_for ~ 106.14.94.192,61.50.105.10 ) {
                        rewrite ^/common/(.*)$ /$1 break;
                        proxy_pass http://pool_businessapi.sqbj.com_tomcat_hd;
                }
            proxy_pass http://pool_businessapi.sqbj.com_tomcat/api;
        }

        location /pay/api {
                if ( $http_x_forwarded_for ~ 106.14.94.192,61.50.105.10 ) {
                        rewrite ^/pay/(.*)$ /$1 break;
                        proxy_pass http://pool_payapi.sqbj.com_tomcat_hd;
                }
            proxy_pass http://pool_payapi.sqbj.com_tomcat/api;
        }


        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
~                                                                                                                                                                                      
~


nginx 灰度配置文件