Support brotli compression

This commit is contained in:
Dryusdan 2024-01-06 12:36:50 +01:00
parent 4140078c40
commit 0b6c7e1755
2 changed files with 36 additions and 20 deletions

View File

@ -49,7 +49,21 @@
- install
- reconfigure
- name: Install Nginx and dependencies
- name: Install Nginx brotli and dependencies
apt:
pkg: "{{item}}"
state: latest
update_cache: yes
with_items:
- libnginx-mod-http-brotli-static
- libnginx-mod-http-brotli-filter
when: nginx_brotli is defined
tags:
- install
- reconfigure
- name: Install Nginx modsecurity and dependencies
apt:
pkg: "{{item}}"
state: latest

View File

@ -77,25 +77,27 @@ http {
font/opentype
image/svg+xml;
# brotli on;
# brotli_static on;
# brotli_buffers 16 8k;
# brotli_comp_level 6;
# brotli_types
# text/css
# text/javascript
# text/xml
# text/plain
# text/x-component
# application/javascript
# application/x-javascript
# application/json
# application/xml
# application/rss+xml
# application/vnd.ms-fontobject
# font/truetype
# font/opentype
# image/svg+xml;
{% if nginx_brotli is defined %}
brotli on;
brotli_static on;
brotli_buffers 16 8k;
brotli_comp_level 6;
brotli_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/vnd.ms-fontobject
font/truetype
font/opentype
image/svg+xml;
{% endif %}
{% if nginx_modsecurity is defined %}
modsecurity on;