Repository navigation
Expand file tree
/
Copy pathnginx.conf
More file actions
82 lines (74 loc) · 1.81 KB
/
Copy pathnginx.conf
File metadata and controls
82 lines (74 loc) · 1.81 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
server {
listen 80;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
etag on;
if_modified_since exact;
# Assets are precompressed at build time (.br/.gz next to each file).
# Dynamic compression only covers whatever was not precompressed.
brotli_static on;
gzip_static on;
gzip_vary on;
brotli on;
brotli_comp_level 5;
brotli_min_length 1024;
brotli_types
text/plain
text/css
text/xml
text/csv
text/javascript
application/json
application/javascript
application/xml
application/manifest+json
image/svg+xml
image/x-icon
application/vnd.ms-fontobject
font/ttf
font/otf;
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_types
text/plain
text/css
text/xml
text/csv
text/javascript
application/json
application/javascript
application/xml
application/manifest+json
image/svg+xml
image/x-icon
application/vnd.ms-fontobject
font/ttf
font/otf;
open_file_cache max=10000 inactive=1h;
open_file_cache_valid 10m;
open_file_cache_min_uses 2;
open_file_cache_errors on;
location = /health {
access_log off;
return 200;
}
# Fingerprinted files never change: phx.digest adds "-<32 hex>",
# Vite chunks/images add "-<8 char base64url>".
location ~* "^/assets/.+-(?:[0-9a-f]{32}|[A-Za-z0-9_-]{8})\.(?:css|js|mjs|map|json|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf|eot|xml|txt|csv|mp3|wav)$" {
root /var/www;
try_files $uri =404;
access_log off;
log_not_found off;
add_header Cache-Control "public, max-age=31536000, immutable" always;
}
location /assets/ {
root /var/www;
try_files $uri =404;
access_log off;
log_not_found off;
add_header Cache-Control "public, max-age=3600, stale-while-revalidate=86400" always;
}
}