Skip to content

Commit

Permalink
make jsdelivr available locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and alphatownsman committed Apr 7, 2024
1 parent 431d5dc commit 6924a5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions boofilsic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@
"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")
Expand Down
8 changes: 7 additions & 1 deletion misc/nginx.conf.d/neodb-dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion misc/nginx.conf.d/neodb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 6924a5d

Please sign in to comment.