diff --git a/ui/nginx.conf b/ui/nginx.conf index 77d91192b..69c08ad72 100644 --- a/ui/nginx.conf +++ b/ui/nginx.conf @@ -1,9 +1,18 @@ server { - listen 3000; + listen 3000; - location / { - root /usr/share/nginx/html/; - include /etc/nginx/mime.types; - try_files $uri $uri/ /index.html; - } + # all assets contain hash in filename, cache forever + location /assets/ { + root /usr/share/nginx/html/; + include /etc/nginx/mime.types; + try_files $uri $uri/ /index.html; + add_header Cache-Control "public, immutable, max-age=31536000, s-maxage=31536000"; + } + + location / { + root /usr/share/nginx/html/; + include /etc/nginx/mime.types; + try_files $uri $uri/ /index.html; + add_header Cache-Control "public"; + } } \ No newline at end of file