File tree Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ nginx_main_template:
312312 rate_limit : false
313313 keyval : false
314314 stream_enable : false
315+ http_global_autoindex : false
315316
316317# Enable creating dynamic templated NGINX HTTP configuration files.
317318# Defaults will not produce a valid configuration. Instead they are meant to showcase
@@ -327,6 +328,7 @@ nginx_http_template:
327328 port : 8081
328329 server_name : localhost
329330 error_page : /usr/share/nginx/html
331+ autoindex : false
330332 ssl :
331333 cert : ssl/default.crt
332334 key : ssl/default.key
@@ -336,6 +338,7 @@ nginx_http_template:
336338 location : /
337339 html_file_location : /usr/share/nginx/html
338340 html_file_name : index.html
341+ autoindex : false
339342 http_demo_conf : false
340343 load_balancer :
341344 locations :
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ nginx_main_template:
145145 rate_limit : false
146146 keyval : false
147147 stream_enable : false
148+ http_global_autoindex : false
148149
149150# Enable creating dynamic templated NGINX HTTP configuration files.
150151# Defaults will not produce a valid configuration. Instead they are meant to showcase
@@ -160,6 +161,7 @@ nginx_http_template:
160161 port : 8081
161162 server_name : localhost
162163 error_page : /usr/share/nginx/html
164+ autoindex : false
163165 ssl :
164166 cert : ssl/default.crt
165167 key : ssl/default.key
@@ -169,6 +171,7 @@ nginx_http_template:
169171 location : /
170172 html_file_location : /usr/share/nginx/html
171173 html_file_name : index.html
174+ autoindex : false
172175 http_demo_conf : false
173176 load_balancer :
174177 locations :
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ server {
2323 listen {{ item.value.port }};
2424{% endif %}
2525 server_name {{ item.value.server_name }};
26+ {% if item .value .autoindex %}
27+ autoindex on;
28+ {% endif %}
2629{% if item .value .load_balancer is defined %}
2730{% for location in item .value .load_balancer .locations %}
2831 location {{ item.value.load_balancer.locations[location] .location }} {
@@ -43,6 +46,9 @@ server {
4346 location {{ item.value.web_server.locations[location] .location }} {
4447 root {{ item.value.web_server.locations[location] .html_file_location }};
4548 index {{ item.value.web_server.locations[location] .html_file_name }};
49+ {% if item .value .web_server .locations [location ].autoindex %}
50+ autoindex on;
51+ {% endif %}
4652 }
4753{% endfor %}
4854{% if item .value .web_server .http_demo_conf %}
Original file line number Diff line number Diff line change 3535{% if nginx_main_template .http_settings .keyval %}
3636 keyval_zone zone={{nginx_main_template.http_settings.keyval.zone}}:32k state=one.keyval;
3737 keyval $arg_text $text zone=one;
38+ {% endif %}
39+ {% if nginx_main_template .http_global_autoindex %}
40+ autoindex on;
3841{% endif %}
3942 include /etc/nginx/conf.d/*.conf;
4043}
Original file line number Diff line number Diff line change 1414 port : 80
1515 server_name : localhost
1616 error_page : /usr/share/nginx/html
17+ autoindex : false
1718 web_server :
1819 locations :
1920 default :
2021 location : /
2122 html_file_location : /usr/share/nginx/html
2223 html_file_name : index.html
24+ autoindex : false
2325 http_demo_conf : false
You can’t perform that action at this time.
0 commit comments