#常见Nginx的中间件架构
#二、代理服务
#配置
Syntax: proxy_pass URL;
Default : ——
Context:location,if in location,limit_except
#例1:(反向代理):
#location ~ /test_proxy.html$ {
# proxy_pass http://127.0.0.1:8080;
#}
#例2:(正向代理)
# resolver 8.8.8.8;
# location / {
# proxy_pass http://$http_host$request_uri;
# }
#******************************其他***********************************
#缓冲区
Syntax: proxy_buffering on|off;
Default : proxy_buffering on;
Context:http,server,location
#其他 proxy_buffer_size、proxy_buffers、proxy_busy_buffers_size
#跳转重定向
Syntax: proxy_redirect default;
proxy_redirect off;proxy_redirect redirect replacement;
Default : proxy_redirct default;
Context:http,server,location
#头信息
Syntax: proxy_set_header field value;
Default : proxy_set_header Host $proxy_host;proxy_set_header Connection close;
Context:http,server,location
#拓展proxy_hide_header、proxy_set_body
#超时
Syntax: proxy_connect_timeout time;
Default : proxy_connect_timeout 60s;
Context:http,server,location
#拓展 proxy_read_timeout、proxy_send_timeout
#例:
#proxy_redirect default;
#
#proxy_set_header Host $http_host;
#proxy_set_header X-Real-IP $remote_addr;
#
#proxy_connect_timeout 30;
#proxy_send_timeout 60;
#proxy_read_timeout 60;
#
#proxy_buffer_size 32k;
#proxy_buffering on;
#proxy_buffers 4 128k;
#proxy_busy_buffers_size 256k;
#proxy_max_temp_file_size 256k;