nginx 反向代理
2017-01-03 14:34:19 小德 Linux 访问次数 1192



upstream test_server {                                                         
    server 100.73.43.20:8080;                                                
    keepalive 2000;
}
server {
    listen       80;                                                         
    server_name  127.0.0.1;                                               
    client_max_body_size 1024M;
    location /test/ {
        proxy_pass http://creditor_server/;
        proxy_set_header Host $host:$server_port;
    }
}


通过该配置,访问nginx地址http://127.0.0.1:80/test的请求会被转发到test_server服务地址http://127.0.0.1:8080/。