-
Notifications
You must be signed in to change notification settings - Fork 22
/
nginx.conf
58 lines (44 loc) · 1.52 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
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Content-Type-Options "nosniff";
add_header Content-Security-Policy "object-src 'none'; frame-ancestors 'none'; form-action 'none'; base-uri 'none'; style-src 'unsafe-inline' 'self'; script-src 'self'";
if ($host ~ ^www\.(?<domain>.+)$) {
return 301 https://$domain$request_uri;
}
if (-d $request_filename) {
rewrite [^/]$ https://$http_host$uri/ permanent;
}
location = /guide/ {
return 302 https://$http_host/guide/architecture/core/;
}
location = /guide/architecture/ {
return 302 https://$http_host/guide/architecture/core/;
}
location = /guide/starting/ {
return 302 https://$http_host/guide/starting/creating-server/;
}
location = /guide/concepts/ {
return 302 https://$http_host/guide/concepts/node/;
}
location = /recipes/ {
return 302 https://$http_host/recipes/authentication/;
}
location = /protocols/ {
return 302 https://$http_host/protocols/ws/spec/;
}
location = /protocols/ws/ {
return 302 https://$http_host/protocols/ws/spec/;
}
location = /protocols/backend/ {
return 302 https://$http_host/protocols/backend/spec/;
}
add_header Cache-Control "public";
location ~* "(\.js|\.css|\.png|\.svg|\.woff2|\.webmanifest)$" {
add_header X-Content-Type-Options "nosniff";
add_header Cache-Control "public, max-age=31536000, immutable";
}
location ~* "^/branding/.*.svg$" {
add_header Cache-Control "public, max-age=86400";
}
location ~* "(\.png|\.ico|\.woff2)$" {
add_header Content-Security-Policy "";
}