root /var/www/files;
location / {
expires 30d;
access_log off;
error_page 404 = @fetch;
error_page 403 = @fetch;
}
location @fetch {
internal;
proxy_pass http://10.0.0.5;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path /tmp/data;
proxy_set_header Host md5.site.ru;
proxy_set_header If-Modified-Since "";
}