Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

Nginx plus cache invalidation problem (3 replies)

$
0
0
Добрый день!
nginx не инвалидирует кеш по патерну.
- версия nginx: version: nginx/1.7.3 (nginx-plus-extras-r4-p1)
- запрос инвалидации кеша: curl -X PURGE -D - "http://i.xxxxxx.yy/html/*-test/*"

upstream s3 {
keepalive 10;

server lm-zzzzzzzz-eu-west.s3-eu-west-1.amazonaws.com fail_timeout=0;

zone s3 512k;
}

proxy_cache_path /tmp/cache
levels=1:2
keys_zone=S3_CACHE:1024m
loader_threshold=300
loader_files=200
inactive=120m;

map $request_method $purge_method {
PURGE 1;
default 0;
}

server {
server_name i.xxxxxx.yy;

status_zone s3;

add_header X-Proxy-Cache $upstream_cache_status;

location / {
try_files $uri @s3;
}

location ~ .mp4$ {
mp4;
mp4_buffer_size 1m;
mp4_max_buffer_size 15m;

try_files $uri @s3;
}

location @s3 {
proxy_set_header Host lm-zzzzzzzz-eu-west.s3-eu-west-1.amazonaws.com;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_intercept_errors on;

proxy_cache S3_CACHE;
proxy_cache_valid 200 168h;
proxy_cache_valid 403 1h;
proxy_cache_bypass $http_cache_purge;
proxy_cache_purge $purge_method;

proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://s3;
}
}

Заранее спасибо!

Viewing all articles
Browse latest Browse all 3102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>