From 64fbc735829e405e676a03603f9fa0818cdf22f8 Mon Sep 17 00:00:00 2001 From: Alireza Date: Fri, 2 Feb 2018 17:42:19 +0330 Subject: [PATCH] Added expires directive and map to nginx, allowing browser to cache rspamd JS,CSS and image files. --- data/conf/nginx/site.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 8a896264..cf81c0b0 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -7,6 +7,13 @@ map $http_x_forwarded_proto $client_req_scheme { https https; } +map $sent_http_content_type $expires { + default off; + text/css 1d; + application/javascript 1d; + ~image/ 1d; +} + server { listen 80 default_server; listen [::]:80 default_server; @@ -81,6 +88,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 { @@ -263,6 +271,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 {