From e77cbfca35ecf7a18ea2bd9f732d3c0f5ea0110b Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Wed, 25 Sep 2024 14:42:50 +0530 Subject: [PATCH] Adding cache control headers --- nginx/nginx.conf | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 5ad797a13ec..595873a4be2 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,21 +1,18 @@ server { + listen 80; + root /usr/share/nginx/html; include mime.types; types { text/javascript js mjs; } - listen 80; + location = /index.html { + expires 6h; + } location / { - root /usr/share/nginx/html; - index index.html index.htm; + expires 7d; try_files $uri $uri/ /index.html; } - - error_page 500 502 503 504 /50x.html; - - location = /50x.html { - root /usr/share/nginx/html; - } }