forked from Blockstream/esplora
-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx.conf.in
66 lines (62 loc) · 1.73 KB
/
nginx.conf.in
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
upstream backend {
server 127.0.0.1:3000;
keepalive 300;
}
upstream prerenderer {
server 127.0.0.1:5001;
keepalive 300;
}
server {
listen 80;
keepalive_requests 100000;
gzip on;
gzip_types application/json text/plain application/xml application/javascript;
gzip_proxied any;
root {STATIC_DIR};
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
{NGINX_LOGGING};
server_tokens off;
add_header X-Frame-Options SAMEORIGIN always;
add_header Content-Security-Policy "{NGINX_CSP}" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
location /{NGINX_PATH}api/ {
proxy_pass http://backend/;
add_header Access-Control-Allow-Origin * always;
}
location /{NGINX_PATH}nojs/ {
proxy_pass http://prerenderer/;
}
location = /{NGINX_PATH}nojs {
return 301 " /{NGINX_PATH}nojs/";
}
location ~ ^/{NGINX_PATH}((tx|block|block-height|address|assets?)/|[a-zA-Z0-9]+$) {
expires 60m;
if ($args = "nojs") {
{NGINX_REWRITE_NOJS};
}
try_files $uri /index.html;
}
location /{NGINX_PATH} {
expires 60m;
if ($args = "nojs") {
{NGINX_REWRITE_NOJS};
}
{NGINX_REWRITE}
}
location = /{NGINX_NOSLASH_PATH} {
if ($args = "nojs") {
{NGINX_REWRITE_NOJS};
}
return 301 " /{NGINX_PATH}";
}
error_page 404 /{NGINX_PATH}notfound.html;
location = /notfound.html {
internal;
}
}