Created
June 15, 2018 19:14
-
-
Save kapb14/14784c4910c25859d1f410d9d114c039 to your computer and use it in GitHub Desktop.
Purge nginx proxy_cache and restart it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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