summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--defaults/main.yml1
-rw-r--r--templates/nginx.j22
2 files changed, 3 insertions, 0 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index 3f67b9d..e5d061a 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -8,6 +8,7 @@ nginx_customize: ""
nginx_auth_file: ""
nginx_enable_http2: true
+nginx_cache_static: true
letsencrypt_wellknown: /var/www/letsencrypt
letsencrypt_activate: false
diff --git a/templates/nginx.j2 b/templates/nginx.j2
index 47e03a2..df0e6ac 100644
--- a/templates/nginx.j2
+++ b/templates/nginx.j2
@@ -62,6 +62,7 @@ server {
deny all;
}
+ {% if nginx_cache_static %}
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# cache static assets and compress them
gzip on;
@@ -69,6 +70,7 @@ server {
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
+ {% endif %}
{{ nginx_custom }}
}