nginx 配置备忘

upstream webgamelogin {

        keepalive 32;

        server 10.20.100.40:8072 max_fails=2 fail_timeout=10s;

        server 10.20.100.25:8072 backup;

}


upstream api {

        keepalive 32;

        server 10.20.100.40:8073 max_fails=2 fail_timeout=10s;

        server 10.20.100.25:8073 backup;

}




server {

        listen       80;

        server_name  gameapi.doutest.com;

        charset utf8;


        location /webgamelogin {

          proxy_pass  http://webgamelogin;

          proxy_redirect default;

          proxy_set_header Host $host;

          proxy_set_header X-Real-IP $remote_addr;

          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        }


        location /api {

          proxy_pass  http://api;

          proxy_redirect default;

          proxy_set_header Host $host;

          proxy_set_header X-Real-IP $remote_addr;

          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        }


        location /crossdomain.xml {

          alias /data/webapps/crossdomain.xml;

          expires 30d;

        }

}


你可能感兴趣的:(nginx,配置)