forked from acaldas/document-model-electron
-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx.conf
72 lines (62 loc) · 2.42 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Security headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Referrer-Policy "no-referrer-when-downgrade";
# add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; worker-src 'self' blob: https://apps.powerhouse.io; connect-src 'self' https://*.sentry.io https://renown.id https://www.renown.id; img-src * data:; object-src 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com";
# Gzip Settings
gzip on;
gzip_types text/plain application/xml text/css text/javascript application/javascript application/json;
gzip_min_length 256;
gzip_comp_level 6;
gzip_vary on;
gzip_proxied any;
gzip_disable "msie6";
# Brotli Settings
brotli on;
brotli_types text/plain application/xml text/css text/javascript application/javascript application/json;
brotli_comp_level 6;
location ${BASE_PATH}/assets {
alias /usr/share/nginx/html/assets;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ${BASE_PATH}/icons.svg {
alias /usr/share/nginx/html/icons.svg;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ${BASE_PATH}/service-worker.js {
alias /usr/share/nginx/html/service-worker.js;
expires -1;
access_log off;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
}
location ${BASE_PATH} {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
}
# Health check endpoints
location /healthz {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}
location /readiness {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}
}