-
Notifications
You must be signed in to change notification settings - Fork 320
Open
Description
I'm not saying wasting of time on it but it just not working as expected, so i build my own purge, kinda fast just in few minutes
proxy_cache_path /var/nginx_cache levels=1:2 keys_zone=my_cache:20m max_size=200m inactive=2h;
proxy_cache_key $uri;
server {
server_name purge;
root /var/www/purge;
index target.php
listen 80;
location / {
try_files $uri $uri/ target.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
<?php
if(!isset($_POST['uri'])){
die('no uri');
}
$uri = $_POST['uri'];
$md5 = md5($uri);
$parent = substr($md5, -1);
$sub = rtrim(substr($md5, -3), $parent);
if(@unlink('/var/nginx_cache/'.$parent.'/'.$sub.'/'.$md5)){
echo 1;
}else{
echo 0;
}
siebeneicher, coleplx and kmille
Metadata
Metadata
Assignees
Labels
No labels