美文网首页
nginx配置

nginx配置

作者: 不排版 | 来源:发表于2018-03-21 11:06 被阅读2次
    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配置

          本文链接:https://www.haomeiwen.com/subject/jxbwqftx.html