10年工作经验,专研网站运维。
全部博文(454)
分类: 系统运维
2015-07-07 08:10:25
一、 Pass a request over different protocols
1. Proxy_pass directive is specified inside a location:
location /some/path/ {
proxy_pass
}
2. The address may also include a port:
location ~ \.php {
proxy_pass}
3. For non-http proxied server, follow:
passes a request to a FastCGI server
· uwsgi_pass passes a request to a uwsgi server
· scgi_pass passes a request to a SCGI server
· memcached_pass passes a request to a memcached server
二、 Modify client request headers
4. Modify passing request headers:
Note: send header to proxied server.
location /some/path/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass
}
5. Prevent a header field, follow:
location /some/path/ {
proxy_set_header Accept-Encoding "";
proxy_pass
}
三、 Config buffer for proxy server
6. Config buffer for proxy server
If not buffering, then receiving data and send data synchronously. If buffering is enabled, then it is not send to the client until the whole response is received.
location /some/path/ {
proxy_buffers 16 4k;
proxy_buffer_size 2k;
proxy_pass
}
7. Disable the buffering
location /some/path/ {
proxy_buffering off;
proxy_pass
}