-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathnginx.conf.template
More file actions
28 lines (23 loc) · 931 Bytes
/
nginx.conf.template
File metadata and controls
28 lines (23 loc) · 931 Bytes
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
server {
listen ${PORT};
listen [::]:${PORT} default;
root /usr/share/nginx/html;
index index.html;
server_name _; # all hostnames
gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
location / {
try_files $uri /index.html;
# Add headers to all responses
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Content-Security-Policy-Report-Only "${CSP_REPORT_ONLY}" always;
}
# TODO: add cache for static files, avoid caching config.js, index.html etc.
}