Add root parameter to server context (#104)

* Add root parameter to server context

* Update NGINX Unit test playbook
This commit is contained in:
Alessandro Fael Garcia 2019-02-15 14:59:38 +01:00 committed by Grzegorz Dzien
parent f29d9c33f0
commit 171b7d0cce
4 changed files with 8 additions and 5 deletions

View File

@ -332,6 +332,7 @@ nginx_http_template:
port: 8081
server_name: localhost
error_page: /usr/share/nginx/html
root: /usr/share/nginx/html
https_redirect: false
autoindex: false
ssl:

View File

@ -163,6 +163,7 @@ nginx_http_template:
port: 8081
server_name: localhost
error_page: /usr/share/nginx/html
root: /usr/share/nginx/html
https_redirect: false
autoindex: false
ssl:

View File

@ -56,13 +56,15 @@ server {
listen {{ item.value.port }};
{% endif %}
server_name {{ item.value.server_name }};
{% if item.value.autoindex is defined and item.value.autoindex %}
autoindex on;
{% if item.value.root is defined and item.value.root %}
root {{ item.value.root }};
{% endif %}
{% if item.value.https_redirect is defined and item.value.https_redirect %}
return 301 https://{{ item.value.server_name }}$request_uri;
{% endif %}
{% if item.value.autoindex is defined and item.value.autoindex %}
autoindex on;
{% endif %}
{% if item.value.reverse_proxy is defined %}
{% for location in item.value.reverse_proxy.locations %}
location {{ item.value.reverse_proxy.locations[location].location }} {

View File

@ -9,4 +9,3 @@
nginx_unit_enable: true
nginx_unit_modules:
- unit-php
- unit-perl