Nginx reverse proxy parameter
一、 Pass arequest over different protocols
1. Proxy_pass directive isspecified inside a location:
proxy_pass http://www.example.com/link/;
2. The address may also include aport:
location ~ \.php {
proxy_pass http://127.0.0.1:8000;
}
3. For non-http proxied server,follow:
· fastcgi_pass passesa request to a FastCGI server
· uwsgi_pass passesa request to a uwsgi server
· scgi_pass passesa request to a SCGI server
· memcached_pass passesa request to a memcached server
二、 Modify client request headers
4. Modify passing request headers:
Note: send header to proxied server.
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8000;
5. Prevent a headerfield, follow:
proxy_set_header Accept-Encoding"";
proxy_pass http://localhost:8000;
三、 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 wholeresponse is received.
proxy_pass http://localhost:8000;
7. Disable the buffering
proxy_pass http://localhost:8000;
|