Only put proxy_cache where we want it

This commit is contained in:
Andrew Godwin 2022-12-22 05:09:33 +00:00
parent 2dd5454637
commit 74edeef3f5

View file

@ -35,7 +35,6 @@ http {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_cache takahe;
# Serves static files from the collected dir
location /static/ {
@ -52,6 +51,7 @@ http {
# Proxies media and remote media with caching
location ~* ^/(media|proxy) {
# Cache media and proxied resources
proxy_cache takahe;
proxy_cache_key $host$uri;
proxy_cache_valid 200 304 4h;
proxy_cache_valid 301 307 4h;
@ -93,6 +93,7 @@ http {
add_header X-Takahe-Accel "HIT";
# Cache these responses too
proxy_cache takahe;
proxy_cache_key $takahe_realuri;
proxy_cache_valid 200 304 720h;
proxy_cache_valid 301 307 12h;