Repository navigation
Expand file tree
/
Copy pathnginx.conf
More file actions
51 lines (43 loc) · 1.58 KB
/
Copy pathnginx.conf
File metadata and controls
51 lines (43 loc) · 1.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Default virtual host: the dashboard site (repo root). The host nginx reaches
# it through /boost/ and passes the original Host header.
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
# The homepage is served only by the virtual host below, never under /boost/.
location = /home { return 404; }
location ^~ /home/ { return 404; }
# Git metadata, CI files and repo plumbing are not part of the site.
location ~ /\. { return 404; }
location ~* ^/(Dockerfile|nginx\.conf|docker-compose\.yml|deploy\.md|README\.md|_config\.yml)$ { return 404; }
location / {
try_files $uri $uri/ =404;
}
}
# Homepage virtual host (see deploy.md, Part 3b). The host nginx sends
# "Host: insights-home.internal" for /, /assets/ and /robots.txt only, so
# these files are never reachable under /boost/.
server {
listen 80;
server_name insights-home.internal;
root /usr/share/nginx/html/home;
location = / {
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "frame-ancestors 'none'" always;
try_files /index.html =404;
}
location ^~ /assets/ {
add_header Cache-Control "public, max-age=3600" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}
location = /robots.txt {
try_files /robots.txt =404;
}
location / {
return 404;
}
}