From 30c9000eff61975d44098cc0978cffbf9f26bf5f Mon Sep 17 00:00:00 2001 From: Sunoru Date: Mon, 11 Nov 2024 04:31:17 +0000 Subject: [PATCH] Enable cache again. --- nginx/conf.d/hub.moon.moe.conf | 102 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/nginx/conf.d/hub.moon.moe.conf b/nginx/conf.d/hub.moon.moe.conf index b65de1b..b9ed859 100644 --- a/nginx/conf.d/hub.moon.moe.conf +++ b/nginx/conf.d/hub.moon.moe.conf @@ -38,66 +38,66 @@ server { try_files $uri @proxy; } - # location /api/v2/media { - # proxy_read_timeout 500; - # client_max_body_size 2g; - # try_files $uri @proxy; - # } + location /api/v2/media { + proxy_read_timeout 500; + client_max_body_size 2g; + try_files $uri @proxy; + } - # location = /sw.js { - # add_header Cache-Control "public, max-age=604800, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location = /sw.js { + add_header Cache-Control "public, max-age=604800, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/assets/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/assets/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/avatars/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/avatars/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/emoji/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/emoji/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/headers/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/headers/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/packs/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/packs/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/shortcuts/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/shortcuts/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/sounds/ { - # add_header Cache-Control "public, max-age=2419200, must-revalidate"; add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # try_files $uri =404; - # } + location ~ ^/sounds/ { + add_header Cache-Control "public, max-age=2419200, must-revalidate"; add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + try_files $uri =404; + } - # location ~ ^/system/ { - # add_header Cache-Control "public, max-age=2419200, immutable"; - # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; - # add_header X-Content-Type-Options nosniff; - # add_header Content-Security-Policy "default-src 'none'; form-action 'none'"; - # try_files $uri =404; - # } + location ~ ^/system/ { + add_header Cache-Control "public, max-age=2419200, immutable"; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; + add_header X-Content-Type-Options nosniff; + add_header Content-Security-Policy "default-src 'none'; form-action 'none'"; + try_files $uri =404; + } location ^~ /api/v1/streaming { proxy_set_header Host $host;