ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Проблема с кэшированием с татики/картинок.


  • To: nginx-ru@xxxxxxxxx
  • Subject: Проблема с кэшированием с татики/картинок.
  • From: "Alec" <nginx-forum@xxxxxxxx>
  • Date: Wed, 09 Jun 2010 15:12:31 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To:Date; bh=w924M6CErNh7vvmnkqytAHaBtIJuXgez3lZo9W9Vwn4=; b=f37t0qnZfv5P84r966cb6fc1C1qJpijX62BTpQ1nqVXBlmhI+bOjKI2aobZBvQrospjjmlGNY/jrwlXSonkdMqkVd0TEBj23L2ZDAU6mxI0qJpn8QHANTtelJnDZEp+n;

####
OS: FreeBSD 7.2
NGINX: 0.7.66
####
>cat nginx.conf
user www;
worker_processes 2;
error_log /var/log/nginx_log.err;
pid /var/run/nginx.pid;
timer_resolution 150ms;
worker_rlimit_nofile 81920;
events {
    worker_connections 64000;
    use kqueue;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx_log.acc;

    sendfile        on;
    tcp_nopush     on;
    keepalive_timeout  0;
    client_max_body_size 20M;

    gzip on;
    gzip_types text/plain text/css application/x-javascript text/xml 
application/xml;
    gzip_buffers 4 8k;
    gzip_comp_level 9;
    gzip_static on;
    gzip_proxied any;

    tcp_nodelay on;
    reset_timedout_connection on;
    server_tokens off;

    proxy_cache_path /tmp/nginx levels= keys_zone=mediacache:100m inactive=7d 
max_size=1g;
    proxy_temp_path /tmp/nginx/tmp;

    server {
        listen       11.22.33.44:60080;
        server_name     ~^(.*)$;

        set $p $host;
        if ($host ~ www\.(.*)){ set $p $1; }

        location / {
            proxy_pass http://127.0.0.1:80;                                     
                                                                         
            proxy_redirect off;                                                 
                                                                             
            proxy_redirect off;                                                 
                                                                             
            proxy_set_header Host $host;                                        
                                                                             
            proxy_set_header X-Real-IP $remote_addr;                            
                                                                             
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

         location ~* 
^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|js|swf|doc|xls|mp3|mid|wma|pdf|ppsx|ttf|xml|txt|tpl)$
 {
            proxy_cache mediacache;
            root /var/www/$p/html;
            add_header Cache-Control public;
            expires 7d;
        }
}
###
>ls -l /tmp |grep nginx
drwxr-xr-x  3 www    wheel       512 Jun  9 17:22 nginx
>ls -l /tmp/nginx
drwx------  2 www  wheel  512 Jun  9 17:20 tmp
###

Сайт прекрасно открывается. Но кэширование не происходит. Если я правильно 
понимаю, должны появляться файлы кэша в /tmp/nginx. Но они не создаются.

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,96419,96419#msg-96419


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.