Skip to content

Commit 171b7d0

Browse files
alessfggdzien
authored andcommitted
Add root parameter to server context (#104)
* Add root parameter to server context * Update NGINX Unit test playbook
1 parent f29d9c3 commit 171b7d0

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ nginx_http_template:
332332
port: 8081
333333
server_name: localhost
334334
error_page: /usr/share/nginx/html
335+
root: /usr/share/nginx/html
335336
https_redirect: false
336337
autoindex: false
337338
ssl:

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ nginx_http_template:
163163
port: 8081
164164
server_name: localhost
165165
error_page: /usr/share/nginx/html
166+
root: /usr/share/nginx/html
166167
https_redirect: false
167168
autoindex: false
168169
ssl:

templates/http/default.conf.j2

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ server {
5656
listen {{ item.value.port }};
5757
{% endif %}
5858
server_name {{ item.value.server_name }};
59-
{% if item.value.autoindex is defined and item.value.autoindex %}
60-
autoindex on;
59+
{% if item.value.root is defined and item.value.root %}
60+
root {{ item.value.root }};
6161
{% endif %}
6262
{% if item.value.https_redirect is defined and item.value.https_redirect %}
6363
return 301 https://{{ item.value.server_name }}$request_uri;
64-
{% endif%}
65-
64+
{% endif %}
65+
{% if item.value.autoindex is defined and item.value.autoindex %}
66+
autoindex on;
67+
{% endif %}
6668
{% if item.value.reverse_proxy is defined %}
6769
{% for location in item.value.reverse_proxy.locations %}
6870
location {{ item.value.reverse_proxy.locations[location].location }} {

tests/playbooks/nginx-unit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
nginx_unit_enable: true
1010
nginx_unit_modules:
1111
- unit-php
12-
- unit-perl

0 commit comments

Comments
 (0)