-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelearn.conf
More file actions
37 lines (30 loc) · 1.44 KB
/
welearn.conf
File metadata and controls
37 lines (30 loc) · 1.44 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
server {
listen 8080;
# Remove Nginx version
server_tokens off;
# Enable compression for everything
gzip on;
gzip_comp_level 6;
gzip_types *;
# Good practice headers
add_header Referrer-Policy "no-referrer" always;
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), screen-wake-lock=(), usb=(), xr-spatial-tracking=()" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Strict-Transport-Security "max-age=31536000" always;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html =404;
# Force browser to request latest index.html, so it will always have the latest CSS/JS chunk from latest build
location ~* \.html?$ {
add_header Cache-Control "no-store, must-revalidate";
add_header Pragma "no-cache";
expires 0;
}
# Enable long cache settings for static files
location ~ \.(jpg|jpeg|png|ico|js|css|woff2|webp|gif)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
}
}