fix: omit "Access rules" directives if no rules configured

When an access list was associated with a template which had users (items) but no rules (clients), a `deny all` directive was inserted to the config. This resulted in all requests, including those with valid credentials, being rejected due to the lack of any `allow` directive.

This commit wraps the access rule configuration inside of an if block, so the `deny all;` directive is only present when at least one rule is configured.
This commit is contained in:
Matthew Kilpatrick
2026-05-15 18:55:46 +00:00
parent 43e0911ce4
commit 52c32b473d
+2
View File
@@ -10,11 +10,13 @@
{% endif %}
{% if access_list.clients.length > 0 %}
# Access Rules: {{ access_list.clients | size }} total
{% for client in access_list.clients %}
{{client | nginxAccessRule}}
{% endfor %}
deny all;
{% endif %}
# Access checks must...
{% if access_list.satisfy_any == 1 or access_list.satisfy_any == true %}