Add varnish cache

This commit is contained in:
weidenwiesel
2026-02-02 10:20:31 +01:00
parent f673e86181
commit 9c2e7dc594
3 changed files with 81 additions and 0 deletions
+15
View File
@@ -18,6 +18,11 @@ upstream invidious_worker {
keepalive 1;
}
# Varnish cache
upstream varnish_invidious {
server 192.42.6.3:6081;
}
geo $upstream_server {
default invidious;
}
@@ -241,6 +246,16 @@ server {
root /srv/nginx/public/invidious;
}
# Varnish cache
location ~^(/vi/|/ggpht/) {
proxy_pass http://varnish_invidious;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Disable anubis for api stats
location = /api/v1/stats {
proxy_set_header Host $host;