ПРОЕКТЫ 


  АРХИВ 


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]

Re: If rewrite



On Wed, May 26, 2010 at 09:47:11AM -0400, No1 wrote:

> Исправил,работает.
> http {
>     include       mime.types;
>     default_type  application/octet-stream;
>     proxy_cache_path  /var/spool/nginx/  levels=1:2   keys_zone=one:2048m;
>     proxy_cache_min_uses 1; 
> 
> 
>   server {
>         listen       80;
>         server_name  
>         access_log  /var/log/nginx/img.access.log  main;
> 
> 
> location ~* ^.(css|js)$ {
> proxy_pass   http://127.0.0.1;
> proxy_store on;
> proxy_temp_path /var/spool/nginx;
> proxy_set_header Host mydomain;
> proxy_set_header If-Modified-Since "";
> expires 1d;
> add_header Last-Modified: $date_gmt;
> add_header Cache-Control: public;
> try_files $uri $uri/;
> if (-f $request_filename) {
> break;
> }
> }
> 
> 
> location ~* ^.+small+(jpeg|jpg|png|gif)$ {
> proxy_pass   http://127.0.0.1;
> proxy_store on;
> proxy_temp_path /var/spool/nginx;
> proxy_set_header Host mydomain;
> proxy_set_header If-Modified-Since "";
> expires 1d;
> add_header Last-Modified: $date_gmt;
> add_header Cache-Control: public;
> try_files $uri $uri/;
> if (-f $request_filename) {
> break;
> }
> } 
> 
> Почему не работает кэширование статики?В /var/spool/nginx ничего нет.Не могу 
> разобраться как должно работать кэширование файлов nginx'om.

http {
    include           mime.types;
    default_type      application/octet-stream;
    proxy_cache_path  /var/spool/nginx/cache  levels=1:2  keys_zone=ONE:2048m;
    proxy_cache_min_uses 1; 

    server {
        listen       80;
        server_name  
        access_log  /var/log/nginx/img.access.log  main;

        location ~* \.(css|js)$ {
            proxy_pass         http://127.0.0.1;
            proxy_set_header   Host mydomain;

            proxy_cache        ONE;
            proxy_cache_valid  1d;
            proxy_temp_path    /var/spool/nginx/temp;

            expires 1d;
            add_header Last-Modified: $date_gmt;
            add_header Cache-Control: public;
        }

        location ~* \.+small+(jpe?g|png|gif)$ {
            proxy_pass         http://127.0.0.1;
            proxy_set_header   Host mydomain;

            proxy_cache        ONE;
            proxy_cache_valid  1d;
            proxy_temp_path    /var/spool/nginx/temp;

            expires 1d;
            add_header Last-Modified: $date_gmt;
            add_header Cache-Control: public;
        }
    }
} 

-- 
Игорь Сысоев
http://sysoev.ru

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


 




Copyright © Lexa Software, 1996-2009.