This repository has been archived on 2021-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
docInfra/FontAndCSSServer.md

28 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2020-05-09 09:30:20 +02:00
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
<FilesMatch "\.(ttf|otf|eot|woff|woff2)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
```
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;
```