make template smart enough to enable brotli if needed
authorSam <sam.saffron@gmail.com>
Tue, 7 Jun 2016 08:06:56 +0000 (18:06 +1000)
committerSam <sam.saffron@gmail.com>
Tue, 7 Jun 2016 08:06:56 +0000 (18:06 +1000)
templates/web.template.yml

index d4c058c7c399365794362fcd23e41191d52f560c..d355a49aa637eaa34b9e72291e145ba913ff39bf 100644 (file)
@@ -118,6 +118,7 @@ run:
         - "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf"
         - "rm /etc/nginx/sites-enabled/default"
         - "mkdir -p /var/nginx/cache"
+        - '[ ! -z "$COMPRESS_BROTLI"] && sed -i "s/# brotli/brotli/" /etc/nginx/conf.d/discourse.conf'
 
   - replace:
       filename: /etc/nginx/nginx.conf