summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-05-17 17:15:50 +0200
committerGuilhem Moulin <guilhem@fripost.org>2020-05-17 18:30:02 +0200
commit4646537cb8b15350bc47d399b35ce206c780d938 (patch)
tree6f29394f60e45eb6f2bd6d61013e376926208634
parentde1a682862d184c24c018e6150bab27c72049fe5 (diff)
nginx: Add MIME type declaration for .woff2 files.
-rw-r--r--roles/common-web/tasks/main.yml13
1 files changed, 12 insertions, 1 deletions
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