mirror of
https://git.nerdvpn.de/NerdVPN.de/invidious
synced 2026-02-14 22:51:42 +01:00
Add varnish cache
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user