Welcome! Log In Create A New Profile

Advanced

настройка кеширования

October 27, 2018 12:56PM
Добрый день!
Настроил кеширование nginx

proxy_cache_path /var/cache/nginx/piccache levels=2 keys_zone=piccache:15m inactive=15m max_size=200m;

server {
listen 81;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;

location /pic/ {
proxy_cache_valid 200 15m;
proxy_cache_key "$request_uri|$request_body";
proxy_hide_header "Set-Cookie";
proxy_cache_methods POST;
proxy_ignore_headers "Cache-Control" "Expires";
proxy_cache piccache;
proxy_pass http://backend;
}


proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;

}

server {
listen 82;

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;

location /pic/ {
proxy_cache_valid 200 15m;
proxy_cache_key "$request_uri|$request_body";
proxy_hide_header "Set-Cookie";
proxy_cache_methods POST;
proxy_ignore_headers "Cache-Control" "Expires";
proxy_cache piccache;
proxy_pass http://backend;


proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;

}


server {
listen 83;

location /pic/ {
proxy_cache_valid 200 15m;
proxy_cache_key "$request_uri|$request_body";
proxy_hide_header "Set-Cookie";
proxy_cache_methods POST;
proxy_ignore_headers "Cache-Control" "Expires";
proxy_cache piccache;
proxy_pass http://backend;
}

proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;

}

Но почему-то в папке /var/cache/nginx/piccache файлы не создаются, а папка для временных файлов не очищается /var/cache/nginx/proxy_temp

Через strace вижу такое
chmod("/var/cache/nginx/proxy_temp/5/18/0000554185", 0600) = 0
rename("/var/cache/nginx/proxy_temp/5/18/0000554185", "/var/cache/nginx/piccache/b7/6d45a7319a3cf5d68022b0c8b55147b7") = 4294967294
fstat(32, {st_mode=S_IFREG|0600, st_size=797, ...}) = 0
close(31)

Версия
nginx -v
nginx version: nginx/1.6.2

я так понял у rename это какой то код ошибки 4294967294 нигде не нашел что это значит
кто может подсказать, в чем проблема
заранее спасибо.
Subject Author Posted

настройка кеширования

sergwed October 27, 2018 12:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
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