From 48a949adc5f3cc5a67612b7b61323b5937bf7536 Mon Sep 17 00:00:00 2001 From: rdelaage Date: Sat, 9 May 2020 09:30:20 +0200 Subject: [PATCH] Ajouter 'FontAndCSSServer.md' --- FontAndCSSServer.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 FontAndCSSServer.md diff --git a/FontAndCSSServer.md b/FontAndCSSServer.md new file mode 100644 index 0000000..0cfa8c0 --- /dev/null +++ b/FontAndCSSServer.md @@ -0,0 +1,28 @@ +Nous allons mettre en place un server de polices et css. Pour Apache on ajoute un simple serveur comme pour un site statique puis on ajoute dans la racine le fichier .htaccess suivant : +``` +AddType application/vnd.ms-fontobject .eot +AddType application/x-font-opentype .otf +AddType image/svg+xml .svg +AddType application/x-font-ttf .ttf +AddType application/font-woff .woff +AddType application/font-woff2 .woff2 + + + Header set Access-Control-Allow-Origin "*" + + +``` +Pour nginx on fait un site statique auquel on ajoute la directive suivante: +``` + location ~* \.(eot|otf|ttf|woff|woff2)$ { + add_header Access-Control-Allow-Origin *; + } +``` +il faut en plus ajouter ceci dans le fichier mime.types de la configuration nginx +``` +font/ttf ttf; +font/otf otf; +font/woff woff; +font/woff2 woff2; +application/vnd.ms-fontobject eot; +``` \ No newline at end of file