From 264033d1884f65845e0b9832015ccd88374d9f57 Mon Sep 17 00:00:00 2001 From: "Eric Johansson (neku)" Date: Sun, 6 Jun 2021 19:38:55 +0200 Subject: [PATCH] Update X.Y.conf --- templates/nginx_confs/X.Y.conf | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/templates/nginx_confs/X.Y.conf b/templates/nginx_confs/X.Y.conf index cb3b034..1bae178 100644 --- a/templates/nginx_confs/X.Y.conf +++ b/templates/nginx_confs/X.Y.conf @@ -15,15 +15,24 @@ autoindex off; access_log off; index index.html index.php; -gzip on; -gzip_min_length 1000; -gzip_comp_level 6; -gzip_proxied any; -gzip_types text/css text/js text/javascript application/javascript image/png application/x-javascript; +location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|xml|eot|woff|woff2|ttf|svg|otf)$ { -location ~* \.(ico|css|js|ttf|png|gif)$ { -expires 7d; -} + add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate"; + + # allow CORS requests + add_header Access-Control-Allow-Origin *; + types {font/opentype otf;} + types {application/vnd.ms-fontobject eot;} + types {font/truetype ttf;} + types {application/font-woff woff;} + types {font/x-woff woff2;} + } + + gzip on; + gzip_min_length 1000; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/css text/js text/javascript application/javascript application/x-javascript; location ~* \.php$ { fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; @@ -34,4 +43,4 @@ include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } -} \ No newline at end of file +}