Skip to content

PHP script to proxy and cache google fonts locally on your server.

Notifications You must be signed in to change notification settings

gruessung/php-gfont-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-gfont-proxy

PHP script to proxy and cache google fonts locally on your server. Easily add index.php?url= in front of all google font calls and this it!

Installation

git clone https://github.com/gruessung/php-gfont-proxy.git
cd php-gfont-proxy
open docker-compose.yml and change BASE_URL to your own!
docker-compose up

Example

https://fonts.your-domain.com/index.php?url=https://fonts.googleapis.com/css?family=Lato:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&ver=5.6

CORS

Sometimes you need an additional .htacess entry

Header set Access-Control-Allow-Origin "*"

License

MIT

About

PHP script to proxy and cache google fonts locally on your server.

Resources

Stars

Watchers

Forks