Applicable to:
- Plesk for Linux
Question
How to activate web fonts for a domain?
Answer
This functionality is not related to Plesk. Instructions below is just general information that may help with activating webfonts, but it is not supported by Plesk:
- For Apache:
- Create an
.htaccess
file in the root folder of the domain, for example, in/var/www/vhosts/example.com/httpdocs/
- Add the following lines in the
.htaccess
:
AddType application/x-font-ttf ttc ttf
AddType application/x-font-otf otf
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType application/vnd.ms-fontobject eot
- In the Domains > example.com > Apache & nginx Settings > Additional directives for HTTP(s) add the following:
<FilesMatch ".(eot|ttf|otf|woff|woff2)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch> - Use the service httpd reload command to reload Apache configuration.
- Create an
- For nginx:
- Add (or modify) the following lines in the
/etc/nginx/mime.types
:
application/x-font-ttf ttc ttf;
application/x-font-otf otf;
application/font-woff woff;
application/font-woff2 woff2;
application/vnd.ms-fontobject eot;
- In the Domains > example.com > Apache & nginx Settings > Additional nginx directives add the following:
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
} - Reload nginx configuration:
# systemctl reload nginx
OR
# service nginx reload
- Add (or modify) the following lines in the
Comments
0 comments
Please sign in to leave a comment.