标签:
转载 |
分类: 网络/p2p |
原文地址:nginx反向代理做cache配置作者:soulmate
前序:请耐性子看完,前面的这个配置可以达到按后缀名进行缓存,但无法被purge。后面的配置可以被purge。
具体实施方案按个人情况而定。
需要第三方的ngx_cache_purge模块:
wget http://labs.frickle.com/files/ngx_cache_purge-1.0.tar.gz
tar zxvf ngx_cache_purge-1.0.tar.gz
nginx机器IP地址:192.168.2.187
编译参数: configure arguments: --add-module=../ngx_cache_purge-1.0 --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
user nobody;
worker_processes 1;
pid
logs/nginx.pid;
worker_rlimit_nofile 65535;
events {
use
epoll;
worker_connections 65535;
}
http {
include
mime.types;
default_type application/octet-stream;
log_format main '$remote_addr -
$remote_user [$time_local] '
'"$request_method $scheme://$host$request_uri $server_protocol"
$status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
server_names_hash_bucket_size
128;
#指定服务器名称哈希表的框大小
client_header_buffer_size
32k;
large_client_header_buffers 4
128k;
#以上两个是设定客户端请求的Header头缓冲区大小,对于
cookie内容较大的请求,应增大改值。(400或414错误)
client_max_body_size
8m;
#允许客户端请求的最大单文件字节数
client_body_buffer_size
32k;
#缓冲区代理缓冲用户端请求的最大字节数,可以理解为保存
到本地再传给用户
proxy_connect_timeout
600;
#nginx跟后端服务器连接超时时间(代理连接超时)
proxy_read_timeout
600;
具体实施方案按个人情况而定。
需要第三方的ngx_cache_purge模块:
wget http://labs.frickle.com/files/ngx_cache_purge-1.0.tar.gz
tar zxvf ngx_cache_purge-1.0.tar.gz
nginx机器IP地址:192.168.2.187
编译参数: configure arguments: --add-module=../ngx_cache_purge-1.0 --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
user
worker_processes
pid
worker_rlimit_nofile 65535;
events {
}
http {