8000 Fix NAP DoS monitor directive by alessfg · Pull Request #190 · nginx/ansible-role-nginx-config · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

BUG FIXES:

Dictionaries are a sequence per Jinja2 contrary to Python's defaults (dictionaries are not a sequence in Python). The template conditionals assumed the latter.
* Dictionaries are a sequence per Jinja2 contrary to Python's defaults (dictionaries are not a sequence in Python). The template conditionals assumed the latter.
* NAP DoS monitor directive would fail if some variables were commented out.

## 0.4.1 (October 25, 2021)

Expand Down
6 changes: 2 additions & 4 deletions templates/http/app_protect.j2
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ app_protect_dos_policy_file {{ app_protect_dos['policy_file'] }};
{% if app_protect_dos['name'] is defined %}
app_protect_dos_name {{ app_protect_dos['name'] }};
{% endif %}
{% if app_protect_dos['monitor'] is defined and app_protect_dos['monitor'] is mapping %}
app_protect_dos_monitor uri={{ app_protect_dos['monitor']['uri'] | ternary(app_protect_dos['monitor']['uri'], app_protect_dos['monitor']) }}{{ app_protect_dos['monitor']['protocol'] | ternary((' protocol=' + app_protect_dos['monitor']['protocol'] | string), '') }}{{ app_protect_dos['monitor']['timeout'] | ternary((' timeout=' + app_protect_dos['monitor']['timeout'] | string), '') }};
{% elif app_protect_dos['monitor'] is defined and app_protect_dos['monitor'] is string %}
app_protect_dos_monitor {{ app_protect_dos['monitor'] }};
{% if app_protect_dos['monitor'] is defined %}
app_protect_dos_monitor {{ app_protect_dos['monitor'] if app_protect_dos['monitor'] is string }}{{ ('uri=' + app_protect_dos['monitor']['uri'] | string) if app_protect_dos['monitor']['uri'] is defined }}{{ (' protocol=' + app_protect_dos['monitor']['protocol'] | string) if app_protect_dos['monitor']['protocol'] is defined }}{{ (' timeout=' + app_protect_dos['monitor']['timeout'] | string) if app_protect_dos['monitor']['timeout'] is defined }};
{% endif %}
{% if app_protect_dos['security_log_enable'] is defined and app_protect_dos['security_log_enable'] is boolean %}
app_protect_dos_security_log_enable {{ app_protect_dos['security_log_enable'] | ternary('on', 'off') }};
Expand Down
0