make jsdelivr available locally

This commit is contained in:
Your Name 2024-04-07 00:01:11 -04:00 committed by Henri Dickson
parent 431d5dc4fd
commit 6924a5d04f
3 changed files with 16 additions and 4 deletions

View file

@ -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")

View file

@ -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.

View file

@ -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.