![如何清除 nginx 代理缓存?](https://linux22.com/image/738605/%E5%A6%82%E4%BD%95%E6%B8%85%E9%99%A4%20nginx%20%E4%BB%A3%E7%90%86%E7%BC%93%E5%AD%98%EF%BC%9F.png)
这是我的 nginx 配置:
proxy_cache_path /tmp/nginxcache levels=1:2 keys_zone=trycatchchris:10m max_size=1g inactive=1440m use_temp_path=off;
server {
listen 3000;
server_name trycatchchris.co.uk;
root /var/www/html/public/;
location / {
proxy_pass http://localhost:3001/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache trycatchchris;
proxy_ignore_headers Cache-Control;
proxy_cache_valid any 1440m;
proxy_no_cache $cookie_nocache $arg_nocache;
proxy_cache_bypass $cookie_nocache $arg_nocache;
add_header X-Proxy-Cache $upstream_cache_status;
}
}
如何清除缓存?
我已经看过了如何清除 nginx 缓存和https://stackoverflow.com/questions/6236078/how-to-clear-the-cache-of-nginx(一个指向另一个)然而有许多答案,并且问题/接受的答案与历史错误有关 - 所以并不是一个很好的参考。