From 4646537cb8b15350bc47d399b35ce206c780d938 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 17 May 2020 17:15:50 +0200 Subject: nginx: Add MIME type declaration for .woff2 files. --- roles/common-web/tasks/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/common-web/tasks/main.yml b/roles/common-web/tasks/main.yml index 28881f7..f059bfc 100644 --- a/roles/common-web/tasks/main.yml +++ b/roles/common-web/tasks/main.yml @@ -50,8 +50,19 @@ notify: - Restart Nginx +# WARN Bullseye: nginx >=1.15.1 uses font/woff and font/woff2 (cf. https://trac.nginx.org/nginx/ticket/1243) +# however Bootstrap(?) appears to query resources with "Accept: application/font-woff" resp. application/font-woff2. +# Unfortunately it also uses "Accept-Encoding: identity" so the resource isn't compressed... +- name: Fix MIME type for woff + lineinfile: dest=/etc/nginx/mime.types + insertafter='^\s*\S+\s\s+woff;' + line=' application/font-woff2 woff2;' + register: r5 + notify: + - Restart Nginx + - name: Start Nginx service: name=nginx state=started - when: not (r1.changed or r2.changed or r3.changed or r4.changed) + when: not (r1.changed or r2.changed or r3.changed or r4.changed or r5.changed) - meta: flush_handlers -- cgit v1.2.3