summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Porte <microjoe@microjoe.org>2017-09-27 21:30:20 +0200
committerRomain Porte <microjoe@microjoe.org>2017-09-27 21:30:20 +0200
commit82c6e49c712f20dd1ec91747dc2f3dbc563964a7 (patch)
tree52e660de243bd97c7b8c9e7790b936f2d6603e76
parent7faffba9262d2ea2c6de6c925af4c9a63f49a275 (diff)
downloadMicroJoe.nginx-staticwebsite-82c6e49c712f20dd1ec91747dc2f3dbc563964a7.tar.gz
MicroJoe.nginx-staticwebsite-82c6e49c712f20dd1ec91747dc2f3dbc563964a7.zip
Allow autoindex
-rw-r--r--defaults/main.yml2
-rw-r--r--templates/nginx.j24
2 files changed, 6 insertions, 0 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index ce3dd06..0dbc02b 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -2,6 +2,8 @@
# defaults file for MicroJoe.staticwebsite
nginx_rewrite_html: false
+nginx_autoindex: false
+
nginx_customize: ""
nginx_auth_file: ""
diff --git a/templates/nginx.j2 b/templates/nginx.j2
index df0e6ac..d186cb5 100644
--- a/templates/nginx.j2
+++ b/templates/nginx.j2
@@ -41,6 +41,10 @@ server {
index index.html;
location / {
+ {% if nginx_autoindex %}
+ autoindex on;
+ {% endif %}
+
{% if nginx_rewrite_html %}
rewrite ^(/.+)\.html$ $1;
try_files $uri.html $uri $uri/ =404;