Skip to content

Commit bd6af6a

Browse files
committed
feat: Template support for the NGINX gzip static module
Closes #380
1 parent 88a38b0 commit bd6af6a

File tree

6 files changed

+8
-1
lines changed

6 files changed

+8
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FEATURES:
66

77
- Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed.
88
- Bump the Ansible `community.general` collection to `9.2.0`, `community.crypto` collection to `2.21.1` and `community.docker` collection to `3.11.0`.
9+
- Add templating support for the `ngx_http_gzip_static_module` NGINX module.
910

1011
BUG FIXES:
1112

defaults/main/template.yml

+1
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ nginx_config_http_template:
579579
http_version: 1.1 # Can be set to '1.0' or '1.1'
580580
min_length: 20
581581
proxied: [] # String or a list of strings -- Can alternatively be set to 'false'
582+
static: false # Boolean or 'always'
582583
types: [] # String or a list of strings
583584
vary: false # Boolean
584585
headers: # Configure headers

molecule/complete/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
min_length: 20
465465
proxied:
466466
- expired
467+
static: always
467468
types:
468469
- text/html
469470
vary: false

molecule/complete_plus/converge.yml

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
min_length: 20
213213
proxied:
214214
- expired
215+
static: false
215216
vary: false
216217
auth_jwt:
217218
enable: false

templates/http/modules.j2

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ gzip_min_length {{ gzip['min_length'] }};
7171
{% if gzip['proxied'] is defined %}
7272
gzip_proxied {{ 'off' if not gzip['proxied'] else (gzip['proxied'] if gzip['proxied'] is string else gzip['proxied'] | join(' ')) }};
7373
{% endif %}
74+
{% if gzip['static'] is defined %}{# ngx_http_gzip_static_module #}{# This does not belong here but we are making an exception #}
75+
gzip_static {{ (gzip['static'] | ternary('on', 'off')) if gzip['static'] is boolean else gzip['static'] if gzip['static'] == 'always' }};
76+
{% endif %}
7477
{% if gzip['types'] is defined %}
7578
gzip_types {{ gzip['types'] if gzip['types'] is string else gzip['types'] | join(' ') }};
7679
{% endif %}

templates/stream/modules.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ access_log {{ 'off' if not log else log['path'] if log['path'] is defined }}{{ (
6767
{{- (' if=' + log['if']) if log['if'] is defined }};
6868
{% endfor %}
6969
{% endif %}
70-
{% if log['error'] is defined %}{# This does not belong here but we are making an exception #}
70+
{% if log['error'] is defined %}{# ngx_core_module #}{# This does not belong here but we are making an exception #}
7171
{% for log in log['error'] if (log['error'] is not mapping and log['error'] is not string) %}
7272
error_log {{ log if log is string else log['file'] }}{{ (' ' + log['level'] | string) if log['level'] is defined }};
7373
{% else %}

0 commit comments

Comments
 (0)