Nginx中conf的相关配置

user icity icity;
worker_processes 12;


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


pid        logs/nginx.pid;


events {
    use epoll;
    worker_connections  204800;
    #worker_connections  10240;
}


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 "$request_body" $request_time ';


    access_log  logs/access.log  main;


    sendfile        on;
    #tcp_nopush     on;


    #keepalive_timeout  0;
    keepalive_timeout  65;


    #gzip  on;


    upstream mobile_phone_clients {
        server 172.168.40.23:8100 max_fails=3 fail_timeout=60s;
        server 172.168.40.23:8101 max_fails=3 fail_timeout=60s;
        server 172.168.40.23:8102 max_fails=3 fail_timeout=60s;


        server 172.168.40.24:8100 max_fails=3 fail_timeout=60s;
        server 172.168.40.24:8101 max_fails=3 fail_timeout=60s;
        server 172.168.40.24:8102 max_fails=3 fail_timeout=60s;
    }
    upstream external_realtime {
        server 172.168.40.23:8103 max_fails=3 fail_timeout=60s;
        server 172.168.40.23:8104 max_fails=3 fail_timeout=60s;
        server 172.168.40.24:8103 max_fails=3 fail_timeout=60s;
        server 172.168.40.24:8104 max_fails=3 fail_timeout=60s;


        #server 172.168.40.22:8100 max_fails=0;
    }
    upstream client_api_tasteless {
        server 172.168.40.26:8104 max_fails=3 fail_timeout=60s;
        server 172.168.40.22:8104 max_fails=3 fail_timeout=60s;


        #server 172.168.40.22:8100 max_fails=0;
    }
    upstream mobile_phone_pic_url {        
        server 172.168.40.23:9990 max_fails=3 fail_timeout=60s;
        server 172.168.40.24:9990 max_fails=3 fail_timeout=60s;
        server 172.168.40.22:9990 max_fails=3 fail_timeout=60s;
    }
    upstream manage_platform {
        server 172.168.40.21:8083 max_fails=0;
    }
    upstream to_wap_sites {
        ip_hash;
        server 172.168.40.42:80 max_fails=3 fail_timeout=60s;
        server 172.168.40.26:29110 max_fails=3 fail_timeout=60s;
    }
    upstream jiaxing_web_sites {
        server 172.168.40.42:80 max_fails=0;
    }
    upstream sichuan_wap_sites {
        server 172.168.40.26:29110 max_fails=0;
    }
    upstream bairenhui_iphone_download_url {
        server 172.168.40.22:9090 max_fails=0;
    }
    upstream bairenhui_manager_sites {
        server 172.168.40.22:9090 max_fails=0;
    }
    upstream bairenhui_client_sites {
        server 172.168.40.22:9090 max_fails=0;
    }
    upstream brh_clients_to_icity {
        server 172.168.40.22:9090 max_fails=0;
    }
    upstream icity-portal-cas {
        server 172.168.40.30:20010 max_fails=0;
    }
    upstream icity-portal-console {
        server 172.168.40.30:20110 max_fails=0;
    }
    upstream icity-portal-universal_photo {
        server 172.168.40.30:20210 max_fails=0;
    }
    upstream icity-portal-publicflat {
        server 172.168.40.30:20310 max_fails=0;
    }
    upstream icity-portal-monitor {
        server 172.168.40.30:20410 max_fails=0;
    }
    upstream icity-portal-authority_mng {
        server 172.168.40.30:20510 max_fails=0;
    }
    upstream icity-portal-cms {
        server 172.168.40.30:20610 max_fails=0;
    }
    upstream icity-portal-other {
        server 172.168.40.30:20710 max_fails=0;
    }
    upstream icity-api-3rd {
        server 172.168.40.25:27010 max_fails=3 fail_timeout=60s;
        server 172.168.40.25:27011 max_fails=3 fail_timeout=60s;
        server 172.168.40.25:27012 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-core {
        server 172.168.40.22:27110 max_fails=3 fail_timeout=60s;
        server 172.168.40.22:27111 max_fails=3 fail_timeout=60s;


        server 172.168.40.26:27110 max_fails=3 fail_timeout=60s;
        server 172.168.40.26:27111 max_fails=3 fail_timeout=60s;


        #server 172.168.40.23:8100 max_fails=3 fail_timeout=60s;
        #server 172.168.40.23:8101 max_fails=3 fail_timeout=60s;
        #server 172.168.40.23:8102 max_fails=3 fail_timeout=60s;
        #server 172.168.40.23:8103 max_fails=3 fail_timeout=60s;


        #server 172.168.40.24:8100 max_fails=3 fail_timeout=60s;
        #server 172.168.40.24:8101 max_fails=3 fail_timeout=60s;
        #server 172.168.40.24:8102 max_fails=3 fail_timeout=60s;
        #server 172.168.40.24:8103 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-jms {
        server 172.168.40.23:27210 max_fails=3 fail_timeout=60s;
        server 172.168.40.23:27211 max_fails=3 fail_timeout=60s;


        server 172.168.40.63:27210 max_fails=3 fail_timeout=60s;
        server 172.168.40.63:27211 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-pay {
        server 172.168.40.23:27310 max_fails=0;
    }
    upstream icity-api-client-busi {
        server 172.168.40.24:27410 max_fails=3 fail_timeout=60s;
        server 172.168.40.63:27410 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-core-ningxia {
        server 172.168.40.25:27510 max_fails=3 fail_timeout=60s;
        server 172.168.40.25:27511 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-other {
        server 172.168.40.22:27610 max_fails=3 fail_timeout=60s;
        server 172.168.40.26:27610 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-v7 {
        server 172.168.40.22:27710 max_fails=3 fail_timeout=60s;
        server 172.168.40.63:27710 max_fails=3 fail_timeout=60s;
    }
    upstream icity-api-client-web {
        server 172.168.40.22:27810 max_fails=3 fail_timeout=60s;
        server 172.168.40.63:27810 max_fails=3 fail_timeout=60s;
    }
    upstream icity-module-cms {
        server 172.168.40.29:8080 max_fails=0;
    }
    upstream icity-module-msgpush {
        server 172.168.40.26:29910 max_fails=0;
    }
    upstream icity-module-batch_ready_sms {
        server 172.168.40.26:29910 max_fails=0;
    }


    server {
        listen       8081;
        server_name  0.0.0.0;


        #charset koi8-r;


        #access_log  logs/host.access.log  main;
        
        send_timeout 20;
        proxy_connect_timeout 8;
        proxy_read_timeout 8;


        location / {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            if ($args ~ "serviceType=1011") {
                proxy_pass http://icity-api-client-core;
                break;
            }


            if ($args ~ "serviceType=1034") {
                proxy_pass http://icity-api-client-core;
                break;
            }


            if ($args ~ "serviceType=1038") {
                proxy_pass http://icity-api-client-core;
                break;
            }


            if ($args ~ "serviceType=1033") {
                proxy_pass http://icity-api-jms;
                break;
            }


            if ($args ~ "serviceType=1017") {
                proxy_pass http://icity-api-jms;
                break;
            }


            if ($args ~ "serviceType=1009") {
                proxy_pass http://icity-api-jms;
                break;
            }
            
            if ($args ~ "serviceType=1044") {
                proxy_pass http://external_realtime;
                break;
            }
            
            if ($args ~ "serviceType=1027") {
                proxy_pass http://client_api_tasteless;
                break;
            }


            if ($args ~ "serviceType=1041") {
                proxy_pass http://icity-api-client-other;
                break;
            }
            
            if ($args ~ "serviceType=1003") {
                proxy_pass http://icity-api-client-other;
                break;
            }
            
            if ($args ~ "serviceType=1008") {
                return 404;
            }
            
            proxy_pass http://mobile_phone_clients;
        }


        location ^~ /icity/service/menu/menuquery/query {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-core;
        }


        location ^~ /icity/service/menu/levelonemenu/query {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-core;
        }


        location ^~ /icity/service/msgsend/msgInfoOper/registerToken {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-jms;
        }


        location ^~ /icity/service/menu/myAppQuery {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /icity/service/menu/widget/query {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /icity/service/personalcenter/mobilelogin/login {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /service/v6/login.action {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /service/encrypt/login.action {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /icity/service/user/getweg {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
        }


        location ^~ /icity/service/user/userOper/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.40.23:8105;
        }


        location ^~ /query {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.40.23:8100;
        }


        location ^~ /icity-api-jms/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-jms;
            client_max_body_size 1000m;
        }


        location ^~ /icity-api-client-pay/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-pay;
            client_max_body_size 1000m;
        }


        location ^~ /icity-api-client-busi/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-busi;
            client_max_body_size 1000m;
        }


        location ^~ /icity-api-client-v7/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-v7;
            client_max_body_size 1000m;
        }


        location ^~ /icity-api-client-web/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-web;
            client_max_body_size 1000m;
        }


location ^~ /icity-api-client-other/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://icity-api-client-other;
            client_max_body_size 1000m;
        }


        location ^~ /icity/service/pc/queryFlowAndCharge/ {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://external_realtime;
        }


        location ^~ /platform2/upload/ {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://mobile_phone_pic_url;
            # add_header Cache-Control no-cache; 
        }


        location ^~ /upload/ {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://mobile_phone_pic_url;
            # add_header Cache-Control no-cache; 
        }


        location ^~ /resources/ {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://mobile_phone_pic_url;
            # add_header Cache-Control no-cache;
        }


        location ^~ /uploadFile.action {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://manage_platform;
        }


        location = /null {
            return 404;
        }


        #error_page  404              /404.html;


        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}


        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    server {
        listen       80;
        server_name  0.0.0.0;
        
        send_timeout 20;
        proxy_connect_timeout 8;
        proxy_read_timeout 8;


        location / {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://to_wap_sites;
        }


        location /NginxStatus {
            stub_status on;
            access_log logs/status_80.log;
            auth_basic "NginxStatus";
        }


        location ^~ /jx/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://jiaxing_web_sites;
        }


        location ^~ /SC {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://sichuan_wap_sites;
        }


        location ^~ /xjsy/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.40.22:9090;
        }


        location ^~ /brhsy/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.40.22:9090;
        }


        location ^~ /brh/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://bairenhui_iphone_download_url;
        }


        location ^~ /BaiRenHuiManager/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://bairenhui_manager_sites;
            client_max_body_size 1000m;
        }


        location ^~ /BaiRenHuiClient/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://bairenhui_client_sites;
        }


        location ^~ /BaiRenHuiPhotoShare/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://brh_clients_to_icity;
            client_max_body_size 1000m;
        }


        location ^~ /ijkwy/ {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.40.57:80;
            client_max_body_size 1000m;
        }


        location = /null {
            return 404;
        }
 
        location = /50x.html {
            root   html;
        }
    }


    server {
        listen       8082;
        server_name  0.0.0.0;


        location / {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://manage_platform;
            client_max_body_size 1000m;
        }


        location ^~ /platform2/upload/ {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://mobile_phone_pic_url; 
        }
        
        location ^~ /icity-portal-cas {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-portal-cas;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-console {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 30;


            proxy_pass http://icity-portal-console;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-universal_photo {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-portal-universal_photo;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-publicflat {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-portal-publicflat;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-monitor {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-portal-monitor;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-authority_mng {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-portal-authority_mng;
            client_max_body_size 1000m;
        }
        
        location ^~ /icity-portal-cms {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            
            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 30;
            
            proxy_pass http://icity-portal-cms;
            client_max_body_size 1000m;
        }


        location ^~ /icity-portal-other {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            
            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 30;
            
            proxy_pass http://icity-portal-other;
            client_max_body_size 1000m;
        }


        location ^~ /icity-module-cms {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-module-cms;
            client_max_body_size 1000m;
        }
        
        location ^~ /icity-module-msgpush {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-module-msgpush;
            client_max_body_size 1000m;
        }


        location ^~ /icity-module-batch_ready_sms {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-module-batch_ready_sms;
            client_max_body_size 1000m;
        }


        location ^~ /exter.shtml {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://mobile_phone_clients;
            client_max_body_size 1000m;
        }


        location = /null {
            return 404;
        }


        location = /50x.html {
            root   html;
        }
    }


    server {
        listen       8888;
        server_name  0.0.0.0;


        location / {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 50;


            if ($args ~ "serviceType=1044") {
                proxy_pass http://external_realtime;
                break;
            }


            if ($args ~ "serviceType=1011") {
                proxy_pass http://icity-api-client-core-ningxia;
                break;
            }


            if ($args ~ "serviceType=1034") {
                proxy_pass http://icity-api-client-core-ningxia;
                break;
            }


            if ($args ~ "serviceType=1038") {
                proxy_pass http://icity-api-client-core-ningxia;
                break;
            }


            proxy_pass http://external_realtime;
        }


        location ^~ /ws/SmsNotification {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://172.168.40.23:8888;
        }


        location ^~ /icityservice {
            root   html;
            index  index.html index.htm;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 60;


            proxy_pass http://172.168.40.22:29810;
        }


        location ^~ /icity-api-3rd {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-api-3rd;
            client_max_body_size 1000m;
        }


        location ^~ /icity/service/menu/menuquery/query {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-api-client-core-ningxia;
            client_max_body_size 1000m;
        }


        location ^~ /icity/service/menu/levelonemenu/query {
            root   html;
            index  index.html index.htm;
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_redirect    off;
            proxy_set_header  Host $http_host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;


            send_timeout 20;
            proxy_connect_timeout 8;
            proxy_read_timeout 8;


            proxy_pass http://icity-api-client-core-ningxia;
            client_max_body_size 1000m;
        }


        location = /null {
            return 404;
        }


        location = /50x.html {
            root   html;
        }
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;


    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}




    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;


    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;


    #    ssl_session_timeout  5m;


    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;


    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}


说明:1。 nginx配置中,先行匹配除 location /  以外的匹配规则,最后剩余的才匹配 location  / 规则。

            2。 location ^~ /icity-api-client-busi/  表示完全匹配  /icity-api-client-busi/




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值