mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-05-18 07:40:35 +00:00
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:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user