Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2916232
  • 博文数量: 454
  • 博客积分: 4860
  • 博客等级: 上校
  • 技术积分: 6375
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 10:08
个人简介

10年工作经验,专研网站运维。

文章分类

全部博文(454)

文章存档

2017年(11)

2016年(13)

2015年(47)

2014年(36)

2013年(147)

2012年(64)

2011年(136)

分类: 系统运维

2015-07-07 08:10:25

                                  Nginx reverse proxy parameter

一、      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:

 

·        fastcgi_pass 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

}

 

 


阅读(1431) | 评论(0) | 转发(0) |
0

上一篇:UFW

下一篇:Nginx 前端及配置

给主人留下些什么吧!~~