diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 1210d18e..bb327a65 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -7,6 +7,15 @@ map $http_x_forwarded_proto $client_req_scheme { https https; } +map $sent_http_content_type $expires { + default off; + text/html off; + text/css 1d; + application/javascript 1d; + application/json off; + image/png 1d; +} + server { include /etc/nginx/mime.types; charset utf-8; @@ -74,6 +83,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; + expires $expires; } location ~* ^/Autodiscover/Autodiscover.xml { @@ -144,6 +154,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -154,6 +165,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -256,6 +268,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; + expires $expires; } location ~* ^/Autodiscover/Autodiscover.xml { @@ -326,6 +339,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -336,6 +350,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; }