Welcome! Log In Create A New Profile

Advanced

Re: If rewrite

May 26, 2010 01:18PM
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@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

If rewrite

No1 May 25, 2010 07:06AM

Re: If rewrite

No1 May 26, 2010 03:45AM

Re: If rewrite

Daniel Podolsky May 26, 2010 04:34AM

Re: If rewrite

No1 May 26, 2010 09:47AM

Re: If rewrite

Igor Sysoev May 26, 2010 01:18PM

Re: If rewrite

No1 May 27, 2010 07:58AM

Re: If rewrite

Igor Sysoev May 27, 2010 08:36AM

Re: If rewrite

No1 May 27, 2010 10:08AM

Re: If rewrite

Igor Sysoev May 27, 2010 11:20AM

Re: If rewrite

Алферов Василий May 28, 2010 02:10AM

Re: If rewrite

No1 May 28, 2010 05:20AM

Re: If rewrite

No1 May 28, 2010 06:27AM

Re: If rewrite

No1 May 28, 2010 08:49AM

Re: If rewrite

Mikhail Mazursky May 28, 2010 05:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 143
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready