1.环境是这样的,用openresty搭建的环境(centos6.4),里面安装有redis ,这台机器的地址是192.168.2.165.作为缓存服务器2.在这台服务器的后台有一台windows server 2003的 网站服务器,192.168.2.1663.我想要的效果是 2.165缓存2.166的数据,比如2.166下面有页面:192.168.2.166/zrq/1.aspx 我想通过192.168.2.165/zrq.1.aspx 去访问,还有就是192.168.2.166/zrq/1.aspx?id=123 带有参数值的页面也要缓存,但我不知道怎么去 用ngx_srcache + ngx_redis2/ngx_redis 将zrq.1.aspx 读取写到redis我的配置如下,不知道怎么弄,请老师们指点下,不知道怎么去关联,在redis 里面没有数据的话怎么关联:# }location / {root html;# default_type text/html;#content_by_lua ' ngx.say ("<p>hello,world</p>")';index index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}location ~* ^.+\.(aspx|asp).+$ {#default_type text/css;set $key $uri;set_escape_uri $escaped_key $key;srcache_fetch GET /redis $key;srcache_store PUT /redis2 key=$escaped_key&exptime=120;error_page 404 502 504 = @zrq;
}
location = /redis {internal;set_md5 $redis_key $args;redis_pass 127.0.0.1:6379;}location = /redis2 {internal;set_unescape_uri $exptime $arg_exptime;set_unescape_uri $key $arg_key;set_md5 $key;redis2_query set $key $echo_request_body;redis2_query expire $key $exptime;redis2_pass 127.0.0.1:6379;}
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html