forked from apache/incubator-devlake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
77 lines (67 loc) · 1.74 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
server {
${LISTENER}
server_name localhost;
absolute_redirect off;
client_max_body_size 20m;
${SERVER_CONF}
root /usr/share/nginx/html;
location = / {
add_header Cache-Control no-cache;
expires 0;
try_files /index.html =404;
}
location / {
try_files $uri /index.html;
}
location /api/ {
resolver ${DNS} valid=${DNS_VALID};
resolver_timeout 3s;
set $target "${DEVLAKE_ENDPOINT}";
rewrite ^ $request_uri;
rewrite ^/api/(.*) $1 break;
return 400;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_pass ${DEVLAKE_ENDPOINT_PROTO}://$target/$uri;
proxy_http_version 1.1;
proxy_set_header "Connection" "";
}
location /api/rest/ {
auth_basic off;
resolver ${DNS} valid=${DNS_VALID};
resolver_timeout 3s;
set $target "${DEVLAKE_ENDPOINT}";
rewrite /api/(.*) /$1 break;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_pass ${DEVLAKE_ENDPOINT_PROTO}://$target;
proxy_http_version 1.1;
proxy_set_header "Connection" "";
}
location /grafana/ {
auth_basic off;
set $external "${USE_EXTERNAL_GRAFANA}";
if ($external = "true") {
return 302 "${GRAFANA_ENDPOINT}";
}
resolver ${DNS} valid=${DNS_VALID};
resolver_timeout 3s;
set $target "${GRAFANA_ENDPOINT}";
proxy_set_header Host $http_host;
proxy_set_header Authorization "";
proxy_set_header X-Forwarded-Access-Token "${cookie_access_token}";
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_pass ${GRAFANA_ENDPOINT_PROTO}://$target;
proxy_http_version 1.1;
proxy_set_header "Connection" "";
}
location /health/ {
auth_basic off;
return 200;
}
location /health {
auth_basic off;
return 200;
}
}