Nginx 反向代理

wenbo.conf

 

upstream wenbo-risk-80 {
    ip_hash;
    server 172.23.10.100:4500 max_fails=3 fail_timeout=15s;
    server 172.23.10.101:4500 max_fails=3 fail_timeout=15s;
}

server {
    listen 6010;
    server_name www.wenbo.com;
    access_log /etc/nginx/logs/wenbo-access.log main;
    error_log /etc/nginx/logs/wenbo-error.log;

location /risk_hr/ {
    proxy_pass http://wenbo-risk-80;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
    }
}

posted @ 2021-03-04 19:38  walkersss  阅读(54)  评论(0编辑  收藏  举报