Nginx - buffer

Intro

对代理进行缓存

Config

1
2
3
4
5
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

开关

1
proxy_buffering on|off

开启后才会使缓冲区配置生效

缓冲区

1
proxy_buffers 256 8k

设置缓冲区数量和大小

1
proxy_buffer_size 8k

设置缓冲区大小

1
proxy_bind $remote_addr transparent;

连接出口绑定为用户真实ip而非本机ip


Reference

http://nginx.org/en/docs/http/ngx_http_proxy_module.html