-
Notifications
You must be signed in to change notification settings - Fork 0
/
googlefonts.conf
46 lines (46 loc) · 1.63 KB
/
googlefonts.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# GoogleFont-Proxy
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Real-IP;
location = /
{
rewrite ^(/.*)$ "https://admincdn.com/" redirect;
}
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
location ~ ^/.*$
{
proxy_pass https://fonts.googleapis.com;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Vary;
proxy_hide_header Strict-Transport-Security;
proxy_hide_header Alt-Svc;
proxy_hide_header cross-origin-opener-policy;
proxy_hide_header cross-origin-resource-policy;
proxy_hide_header x-content-type-options;
proxy_hide_header x-frame-options;
proxy_set_header Host fonts.googleapis.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_ssl_session_reuse off;
proxy_ssl_server_name on;
resolver 8.8.8.8 ipv6=off;
add_header Access-Control-Allow-Origin *;
add_header Vary User-Agent;
sub_filter_types *;
sub_filter "cdnjs.cloudflare.com/ajax/libs" "cdnjs.admincdn.com";
sub_filter "ajax.googleapis.com" "googleajax.admincdn.com";
sub_filter "fonts.googleapis.com" "googlefonts.admincdn.com";
sub_filter "fonts.gstatic.com" "gstatic.admincdn.com";
sub_filter_once off;
# Set Nginx Cache
proxy_ignore_headers Set-Cookie Cache-Control expires;
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args$http_user_agent;
proxy_cache_valid 200 304 301 302 30d;
expires 30d;
add_header AdminCDN-Cache $upstream_cache_status;
}