请教nginx proxy_cache缓存问题

28 views
Skip to first unread message

狗尾草

unread,
Oct 26, 2012, 12:13:33 PM10/26/12
to sh...@googlegroups.com
配置后,访问没问题,但cache目录没有生成缓存问题,是何原因?怎么测试缓存是否生效?看heard的缓存时间?

配置文件
   
  #77 site start
  upstream appserver { 
        server 127.0.0.1:81;
  }
  server {
    listen 80;
    server_name www.77.com 77.com;
    if ($host != 'www.77.com' ) {
      rewrite ^/(.*)$ http://www.77.com/$1 permanent;
    }
location / {  
            proxy_cache cache_one;  
            proxy_temp_path /data/nginx/tmp;  
            #proxy_cache_key "$request_uri$request_body";  
            #proxy_cache_methods GET POST;  
            proxy_cache_valid 200 304 1m;  
            proxy_pass http://appserver;  
        }
}
# 77 site end 

  
  #77 site start 81
  server {
    listen 81;
    server_name www.77.com;
    index index.html index.htm index.php;
    root  /data/web/77.com/htdocs/;
    include /data/web/77.com/htdocs/.htaccess;
    location ~ .*.php$ 
{
 include fcgi.conf;
      fastcgi_index index.php;
 fastcgi_pass 127.0.0.1:9000;
}
location =/ {
    if ($http_user_agent ~ "(iPhone)|(Opera\sMini)|(MIDP-[0-9])|(MIDP[0-9])|(SymbianOS)|(Symbian\sOS)|(Windows\sCE)|(BlackBerry)|(^SonyEricsson)|(^Nokia)|(^NOKIA)|(UP\.Link)|(^SAMSUNG)|(^MOT-)|(^DoCoMo)|(UP\.Browser)|(^Mitsu)|(UCWEB)|(MAUI)|(^Palm)|(^Blazer)|(^BIRD\.E868)"){
                rewrite "^.*$" http://www.77.com/wap/now.php;
                break;
}
}
    log_format 77_log
     '$remote_addr - $remote_user [$time_local] '
                          '"$request" $status $body_bytes_sent '
                          '"$http_referer" "$http_user_agent"';
    access_log /var/log/nginx/77.log 77_log;
}
# 77 site end 


--
Best regards,
Hunk Guo
--

Perry

unread,
Oct 26, 2012, 10:56:16 PM10/26/12
to sh...@googlegroups.com
proxy_temp_path /data/nginx/tmp;  此目录nginx是否可写?

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
 
 



--
Perry | 彭琪

狗尾草

unread,
Oct 26, 2012, 11:38:25 PM10/26/12
to sh...@googlegroups.com
可写,用户和组都为www,目录权限是775.

--
Best regards,
Hunk Guo
--



Reply all
Reply to author
Forward
0 new messages