diff --git a/states/nginx/templates/types/rainloop.j2 b/states/nginx/templates/types/rainloop.j2 index 76fd26b..c154ad6 100644 --- a/states/nginx/templates/types/rainloop.j2 +++ b/states/nginx/templates/types/rainloop.j2 @@ -13,6 +13,19 @@ server { index index.php index.html; + {%- if internal and not auth %} + if ($allow = false) { + return 403; + } + {%- endif %} + if ($allow = true) { + set $auth "off"; + } + {%- if auth %} + auth_basic $auth; + auth_basic_user_file {{ config_dir }}/auth/htpasswd; + {%- endif %} + {%- for key,value in headers.items() %} add_header {{ key }} "{{ value }}"; {%- endfor %}