forked from InseeFrLab/vite-insee-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
30 lines (24 loc) · 790 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
server {
listen 8080;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/xml;
gzip_disable "MSIE [1-6]\.";
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
# Vite generates filenames with hashes so we can
# tell the browser to keep in cache the resources.
location ^~ /static/ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(html|json|txt)$ {
try_files $uri =404;
expires -1; # No cache for these file types
}
}