diff --git a/boofilsic/settings.py b/boofilsic/settings.py index 3a914bf2..5f58476b 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -179,9 +179,9 @@ SITE_INFO = { "site_description": env("NEODB_SITE_DESCRIPTION"), "site_head": env("NEODB_SITE_HEAD"), "site_links": [{"title": k, "url": v} for k, v in env("NEODB_SITE_LINKS").items()], - # "cdn_url": "/cdn", + "cdn_url": "/jsdelivr", # "cdn_url": "https://cdn.jsdelivr.net", - "cdn_url": "https://fastly.jsdelivr.net", + # "cdn_url": "https://fastly.jsdelivr.net", } SETUP_ADMIN_USERNAMES = env("NEODB_ADMIN_USERNAMES") diff --git a/misc/nginx.conf.d/neodb-dev.conf b/misc/nginx.conf.d/neodb-dev.conf index 28f29bd2..ca62389b 100644 --- a/misc/nginx.conf.d/neodb-dev.conf +++ b/misc/nginx.conf.d/neodb-dev.conf @@ -22,6 +22,12 @@ server { proxy_hide_header X-Takahe-User; proxy_hide_header X-Takahe-Identity; + # make jsdelivr available locally + location /jsdelivr/ { + rewrite /jsdelivr/(.*) /$1; + set $takahe_realuri https://cdn.jsdelivr.net$uri; + rewrite ^/(.+) /__takahe_accel__/real/; + } # allow admin to serv their own robots.txt/favicon.ico/... location ~ ^/\w+\.\w+$ { root /www/root; @@ -62,7 +68,7 @@ server { # Only allow internal redirects internal; - # # Reconstruct the remote URL + # Reconstruct the remote URL resolver 9.9.9.9 8.8.8.8 valid=300s; # Unset Authorization and Cookie for security reasons. diff --git a/misc/nginx.conf.d/neodb.conf b/misc/nginx.conf.d/neodb.conf index 22eb9d51..5d3aa1e3 100644 --- a/misc/nginx.conf.d/neodb.conf +++ b/misc/nginx.conf.d/neodb.conf @@ -26,6 +26,12 @@ server { proxy_hide_header X-Takahe-User; proxy_hide_header X-Takahe-Identity; + # make jsdelivr available locally + location /jsdelivr/ { + rewrite /jsdelivr/(.*) /$1; + set $takahe_realuri https://cdn.jsdelivr.net$uri; + rewrite ^/(.+) /__takahe_accel__/real/; + } # allow admin to serv their own robots.txt/favicon.ico/... location ~ ^/\w+\.\w+$ { root /www/root; @@ -74,7 +80,7 @@ server { # Only allow internal redirects internal; - # # Reconstruct the remote URL + # Reconstruct the remote URL resolver 9.9.9.9 8.8.8.8 valid=300s; # Unset Authorization and Cookie for security reasons.