Enable autoindex in http, server and location namespaces (#75)
* Added condition to use new autoindex variable * Added condition to use new autoindex variable for separate virtual hosts * Added global autoindex and autoindex for separate virutal hosts * Added autoindex enabling for virtual host namespace * Added autoindex enabling for virtual host namespace variable * Added autoindex for testing puprposes * Changed autoindex to false * Added autoindex for virtual host * Added autoindex ot readme file
This commit is contained in:
parent
e9a3e6a8e2
commit
df84780f02
@ -312,6 +312,7 @@ nginx_main_template:
|
|||||||
rate_limit: false
|
rate_limit: false
|
||||||
keyval: false
|
keyval: false
|
||||||
stream_enable: false
|
stream_enable: false
|
||||||
|
http_global_autoindex: false
|
||||||
|
|
||||||
# Enable creating dynamic templated NGINX HTTP configuration files.
|
# Enable creating dynamic templated NGINX HTTP configuration files.
|
||||||
# Defaults will not produce a valid configuration. Instead they are meant to showcase
|
# Defaults will not produce a valid configuration. Instead they are meant to showcase
|
||||||
@ -327,6 +328,7 @@ nginx_http_template:
|
|||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
autoindex: false
|
||||||
ssl:
|
ssl:
|
||||||
cert: ssl/default.crt
|
cert: ssl/default.crt
|
||||||
key: ssl/default.key
|
key: ssl/default.key
|
||||||
@ -336,6 +338,7 @@ nginx_http_template:
|
|||||||
location: /
|
location: /
|
||||||
html_file_location: /usr/share/nginx/html
|
html_file_location: /usr/share/nginx/html
|
||||||
html_file_name: index.html
|
html_file_name: index.html
|
||||||
|
autoindex: false
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
load_balancer:
|
load_balancer:
|
||||||
locations:
|
locations:
|
||||||
|
@ -145,6 +145,7 @@ nginx_main_template:
|
|||||||
rate_limit: false
|
rate_limit: false
|
||||||
keyval: false
|
keyval: false
|
||||||
stream_enable: false
|
stream_enable: false
|
||||||
|
http_global_autoindex: false
|
||||||
|
|
||||||
# Enable creating dynamic templated NGINX HTTP configuration files.
|
# Enable creating dynamic templated NGINX HTTP configuration files.
|
||||||
# Defaults will not produce a valid configuration. Instead they are meant to showcase
|
# Defaults will not produce a valid configuration. Instead they are meant to showcase
|
||||||
@ -160,6 +161,7 @@ nginx_http_template:
|
|||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
autoindex: false
|
||||||
ssl:
|
ssl:
|
||||||
cert: ssl/default.crt
|
cert: ssl/default.crt
|
||||||
key: ssl/default.key
|
key: ssl/default.key
|
||||||
@ -169,6 +171,7 @@ nginx_http_template:
|
|||||||
location: /
|
location: /
|
||||||
html_file_location: /usr/share/nginx/html
|
html_file_location: /usr/share/nginx/html
|
||||||
html_file_name: index.html
|
html_file_name: index.html
|
||||||
|
autoindex: false
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
load_balancer:
|
load_balancer:
|
||||||
locations:
|
locations:
|
||||||
|
@ -23,6 +23,9 @@ server {
|
|||||||
listen {{ item.value.port }};
|
listen {{ item.value.port }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
server_name {{ item.value.server_name }};
|
server_name {{ item.value.server_name }};
|
||||||
|
{% if item.value.autoindex %}
|
||||||
|
autoindex on;
|
||||||
|
{% endif %}
|
||||||
{% if item.value.load_balancer is defined %}
|
{% if item.value.load_balancer is defined %}
|
||||||
{% for location in item.value.load_balancer.locations %}
|
{% for location in item.value.load_balancer.locations %}
|
||||||
location {{ item.value.load_balancer.locations[location].location }} {
|
location {{ item.value.load_balancer.locations[location].location }} {
|
||||||
@ -43,6 +46,9 @@ server {
|
|||||||
location {{ item.value.web_server.locations[location].location }} {
|
location {{ item.value.web_server.locations[location].location }} {
|
||||||
root {{ item.value.web_server.locations[location].html_file_location }};
|
root {{ item.value.web_server.locations[location].html_file_location }};
|
||||||
index {{ item.value.web_server.locations[location].html_file_name }};
|
index {{ item.value.web_server.locations[location].html_file_name }};
|
||||||
|
{% if item.value.web_server.locations[location].autoindex %}
|
||||||
|
autoindex on;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if item.value.web_server.http_demo_conf %}
|
{% if item.value.web_server.http_demo_conf %}
|
||||||
|
@ -35,6 +35,9 @@ http {
|
|||||||
{% if nginx_main_template.http_settings.keyval %}
|
{% if nginx_main_template.http_settings.keyval %}
|
||||||
keyval_zone zone={{nginx_main_template.http_settings.keyval.zone}}:32k state=one.keyval;
|
keyval_zone zone={{nginx_main_template.http_settings.keyval.zone}}:32k state=one.keyval;
|
||||||
keyval $arg_text $text zone=one;
|
keyval $arg_text $text zone=one;
|
||||||
|
{% endif %}
|
||||||
|
{% if nginx_main_template.http_global_autoindex %}
|
||||||
|
autoindex on;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
port: 80
|
port: 80
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
autoindex: false
|
||||||
web_server:
|
web_server:
|
||||||
locations:
|
locations:
|
||||||
default:
|
default:
|
||||||
location: /
|
location: /
|
||||||
html_file_location: /usr/share/nginx/html
|
html_file_location: /usr/share/nginx/html
|
||||||
html_file_name: index.html
|
html_file_name: index.html
|
||||||
|
autoindex: false
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
|
Loading…
Reference in New Issue
Block a user