你好 开启后 报这个错误 但是我的脚本只是打出普通的http 200状态 谢谢
------------------ 原始邮件 ------------------
发送时间: 2012年7月17日(星期二) 凌晨2:16
收件人: "lyerwtyr";
抄送: "openresty";
主题: Re: 你好 貌似srcache-nginx-module 这个模块不工作 我netstat -an|grep 11211查看memcached有连接数,但是没有设置memcache的值 就是memcaced里面没有值
Hello!
On Sun, Jul 15, 2012 at 11:19 PM, lyerwtyr <
lyerwtyr@gmail.com> wrote:
> 你好 貌似srcache-nginx-module 这个模块不工作 我netstat -an|grep
> 11211查看memcached有连接数,但是没有设置memcache的值 就是memcaced里面没有值
> 谢谢 麻烦帮忙看看 谢谢
>
> nginx version: nginx/1.0.15
> built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
> TLS SNI support enabled
> configure arguments: --user=www --group=www --prefix=/usr/local/nginx
> --with-http_stub_status_module --with-http_ssl_module
> --with-http_gzip_static_module --with-ipv6
> --add-module=../agentzh-memc-nginx-module-4007350
> --add-module=../agentzh-srcache-nginx-module-bee0276
> --add-module=../ngx_http_upstream_keepalive-d9ac9ad67f45
> 下面是我的nginx配置参数 srcache和memc和keepalive都是下的最新版本
>
> upstream xxx_memcache {
> server 127.0.0.1:11211;
> keepalive 512 single;
> }
> server
> {
> listen 80;
> server_name www.xxx.com xxx.com;
> index index.html index.htm index.php;
> root /var/www/xxx.com/;
> if ($host != 'xxx.com' ) {
> rewrite ^/(.*)$
http://xxx.com/$1 permanent;
> }
> location /xxx_memc {
> internal;
> memc_connect_timeout 600ms;
> memc_send_timeout 600ms;
> memc_read_timeout 600ms;
> set $memc_key $arg_key;
> set $memc_exptime 600;
> memc_pass xxx_memcache;
> }
>
> if (!-e $request_filename) {
> rewrite ^(.+)$ /index.php?q=$1 last;
> }
>
>
> location ~ .*\.(php)?$
> {
> #srcache-nginx-module
> set $key $host$request_uri;
> srcache_fetch_skip 0;
> srcache_store_skip 0;
> #add_header 'xcache' $key;
> srcache_fetch GET /xxx_memc key=$key;
> srcache_store PUT /xxx_memc key=$key;
> srcache_methods GET PUT;
> fastcgi_pass unix:/tmp/php-cgi.sock;
> fastcgi_index index.php;
> include fcgi.conf;
> }
>
>
> location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
> {
> expires 30d;
> access_log off;
> }
>
> location ~ .*\.(js|css)?$
> {
> expires 12h;
> access_log off;
> }
>
> access_log /usr/local/nginx/logs/access.log access;
> }
>
从现象上看,像是你的 PHP 响应被识别为不可缓存的响应。
请启用 nginx 的调试日志(见
http://wiki.nginx.org/Debugging#Debugging_log中的步骤),然后重新运行你的测试请求,查看 nginx 错误日志文件 error.log 中包含 srcache
字眼的调试信息。一般调试日志中会给出 ngx_srcache 拒绝缓存你的响应的原因 :)
P.S. 我抄送给了 openresty 邮件列表:
https://groups.google.com/group/openresty/这样其他用户和开发者也能看到我们这里的讨论。也欢迎你加入这个列表 :)
Best regards,
-agentzh