From 3c932205fb4bcfcc199e64cb3f83f39e854008a8 Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 29 May 2024 17:42:47 +0800 Subject: [PATCH] nginx config add image, video file cache control --- conf/nginx_machete.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conf/nginx_machete.conf b/conf/nginx_machete.conf index e383620..f644f36 100644 --- a/conf/nginx_machete.conf +++ b/conf/nginx_machete.conf @@ -11,6 +11,14 @@ server { root /var/www/machete/www; index index.php index.html; + location ~ .*\.(gif|jpg|jpeg|png|webp|bmp|swf|js|css|ico|mp4|ts)$ { + expires 30d; + } + + gzip on; + gzip_comp_level 4; + gzip_types text/css text/xml application/x-javascript application/atom+xml application/rss+xml application/x-shockwave-flash; + location / { try_files $uri $uri/ /index.php?$args; }