From 891b5f3feeeaf39e58bbb4d6d0a4f4bc0200e05f Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Fri, 26 Feb 2021 20:41:53 +0100 Subject: [PATCH] Tell browsers to cache Gitea avatars for 30 days fixes #312 --- .../kosmos_gitea/templates/default/nginx_conf.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/site-cookbooks/kosmos_gitea/templates/default/nginx_conf.erb b/site-cookbooks/kosmos_gitea/templates/default/nginx_conf.erb index 2540434..7965156 100644 --- a/site-cookbooks/kosmos_gitea/templates/default/nginx_conf.erb +++ b/site-cookbooks/kosmos_gitea/templates/default/nginx_conf.erb @@ -24,10 +24,15 @@ server { client_max_body_size 20M; - location / { - # Increase number of buffers. Default is 8 + location ~ ^/(avatars|repo-avatars)/.*$ { proxy_buffers 1024 8k; + proxy_pass http://_gitea; + proxy_http_version 1.1; + expires 30d; + } + location / { + proxy_buffers 1024 8k; proxy_pass http://_gitea; proxy_http_version 1.1; }