Skip to content

Instantly share code, notes, and snippets.

@nawawi
Last active August 25, 2019 17:03
Show Gist options
  • Save nawawi/a5c0d7601bf94a72977132a41be78bbe to your computer and use it in GitHub Desktop.
Save nawawi/a5c0d7601bf94a72977132a41be78bbe to your computer and use it in GitHub Desktop.
#!/bin/bash
# please refer to https://github.com/nawawi/nginx-cache-data/blob/master/nginx-proxy-cache-data.sh
cat /tmp/nginx-proxy-cache-data/data-file-cache.txt |grep -v ^# |tr -s '|' ' ' |while read _host _size _url; do
_purge="$(echo $_url|sed -e "s/$_host/${_host}\/purge/g")";
_output="$(curl -s -H "Host: ${_host}" ${_purge}*)";
echo $_output;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment