caching.sh 367 B

12345678910111213141516171819
  1. #!/bin/bash
  2. user=$1
  3. domain=$2
  4. ip=$3
  5. home=$4
  6. docroot=$5
  7. str="proxy_cache_path /var/cache/nginx/$domain levels=2"
  8. str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
  9. conf='/etc/nginx/conf.d/01_caching_pool.conf'
  10. if [ -e "$conf" ]; then
  11. if [ -z "$(grep "=${domain}:" $conf)" ]; then
  12. echo "$str" >> $conf
  13. fi
  14. else
  15. echo "$str" >> $conf
  16. fi