-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
48 lines (39 loc) · 1.13 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# If no Host match, close the connection to prevent host spoofing
# Not needed on k8s, as we already have an ingress that filters hosts.
#server {
# listen 80 default_server;
# return 444;
#}
# Health endpoint.
server {
listen 9090;
location = /health {
add_header Content-Type text/plain;
return 200 'ok';
}
}
server {
listen 8000;
keepalive_timeout 60;
client_max_body_size 4G;
# path for static files
root /var/www/sltech/;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript text/javascript model/gltf-binary;
gzip_static on;
gzip_comp_level 8;
# SPA: redirect all traffic to index.html unless otherwise found
# TODO: there should probably be some tighter rules around that somehow to get real 404s.
location / {
try_files $uri /index.html =404;
}
# Add some caching for assets (images, scripts).
# Vite automatically hashes those files so this is rather safe.
location /assets/ {
access_log off;
expires 7d;
add_header Cache-Control public;
}
}