This is a fairly simple task to establish the synchronization of two lists, since the number of MIME types that can benefit from compression is about 20.
If you absolutely need to manage the list from a central location, I would suggest exploring the development of the Ansible play to bring the Nginx configuration to the server.
The part of the Ansible play that is relevant for pressing the appropriate configuration will look like this:
- name: "Set fact for compressible MIME types" set_fact: compressibles: - "text/css" - "application/javascript" - "..." - name: "copy {{ item }} conf.d config file" template: src: "{{ item }}.conf.j2" dest: "/etc/nginx/conf.d/{{ item }}.conf" with_items: - brotli - gzip notify: reload nginx
gzip.conf.j2:
gzip on; gzip_types {{ compressibles|join(' ') }}; # whatever else you think is relevant for gzip configuration # ...
brotli.conf.j2
brotli on; brotli_types {{ compressibles|join(' ') }}; # whatever else you think is relevant for brotli configuration # ...
source share