From eea06d3eaffb3682733e1ed2a08ced7abcca85c2 Mon Sep 17 00:00:00 2001
From: Joe <bousset.rudy@gmail.com>
Date: Wed, 27 Apr 2022 15:39:10 +0000
Subject: nginx update

---
 usr/local/etc/nginx/nginx.conf | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'usr/local')

diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf
index 2cfd861..4b4381b 100644
--- a/usr/local/etc/nginx/nginx.conf
+++ b/usr/local/etc/nginx/nginx.conf
@@ -13,13 +13,22 @@ http {
 	gzip_vary		on;
 	gzip_min_length		1024;
 	gzip_proxied		expired no-cache no-store private auth;
+	map $sent_http_content_type $expires {
+		default                    off;
+		text/css                   15m;
+		application/javascript     15m;
+		~image/                    15m;
+	}
+
 
 	server{
 		server_name  jozanofastora.xyz;
-		root   /usr/local/www/jozan;
-		index  index.html;
+		expires $expires;
+
 		location / {
+			root   /usr/local/www/jozan;
 			try_files $uri $uri/ =404;
+			index  index.html;
 		} 
 		location ~ /\.ht {
 			deny all;
@@ -48,9 +57,10 @@ http {
 
 	server{
 		server_name  gitjoe.xyz git.jozanofastora.xyz;
-		root   /usr/local/www/gitjoe;
-		index  index.html;
+		expires $expires;
 		location / {
+			root   /usr/local/www/gitjoe;
+			index  index.html;
 			try_files $uri $uri/ =404;
 		} 
 		location ~ /\.ht {
@@ -86,7 +96,7 @@ http {
 
 		# Serve static files with nginx
 		location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) {
-			root /usr/share/webapps/cgit;
+			root /usr/local/www/cgit;
 			expires 30d;
 		}
 		location / {
-- 
cgit v1.2.3