Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created June 15, 2018 19:14
Show Gist options
  • Select an option

  • Save kapb14/14784c4910c25859d1f410d9d114c039 to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/14784c4910c25859d1f410d9d114c039 to your computer and use it in GitHub Desktop.
Purge nginx proxy_cache and restart it
#!/bin/bash
set -e
nginx -t
echo " remove all subdirectories of nginx proxy_cache_path"
for dir in $(nginx -T 2>&1 | grep proxy_cache_path | awk $'{print $2}'); do
rm -rf ${dir}/*
done
echo " restart nginx daemon"
service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment