nginx配置

upstream wptest_server {

         #ip_hash;

         server 192.168.16.181:8090 weight=1 max_fails=5 fail_timeout=10s;

         server 192.168.17.101:8090 weight=1 max_fails=5 fail_timeout=10s;

     }

server {

    listen       80;

    server_name  wptest.istarshine.com;

    #root         /usr/share/nginx/html;

    #charset koi8-r;

    access_log  /var/log/nginx/wptest.access.log  main;

    location /{

            server_name_in_redirect off;

            proxy_pass [http://wptest_server](http://wptest_server);

            proxy_next_upstream http_500 http_502 http_503 error timeout invalid_header;

            proxy_set_header X-Real-IP $remote_addr;

            proxy_set_header  Host $host;

    }

}

server {

    listen       80;

    server_name  wptest.istarshine.com;

    #root         /usr/share/nginx/html;

    #charset koi8-r;

    access_log  /var/log/nginx/wptest.access.log  main;

    location =/{

            server_name_in_redirect off;

            proxy_pass [http://192.168.17.103:8080/zhwp/](http://192.168.17.103:8080/zhwp/);

            proxy_set_header X-Real-IP $remote_addr;

            proxy_set_header  Host $host;

    }

    location /zhwp/{

            server_name_in_redirect off;

            proxy_pass [http://192.168.17.103:8080](http://192.168.17.103:8080);

            proxy_next_upstream http_500 http_502 http_503 error timeout invalid_header;

            proxy_set_header X-Real-IP $remote_addr;

            proxy_set_header  Host $host;

    }

}

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