-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
58 lines (44 loc) · 1.6 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
server {
listen 80;
server_name $host;
rewrite ^/$ https://$host/_plugin/kibana redirect;
location ^~ /healthcheck {
access_log off;
return 200 'Healthy';
add_header Content-Type text/plain;
}
location ^~ /_plugin/kibana {
# use aws dns resolver
resolver 169.254.169.253 valid=30s;
set $upstream_es {es_endpoint};
set $upstream_cognito {cognito_endpoint};
# Forward requests to Kibana
proxy_pass https://$upstream_es/_plugin/kibana;
# Handle redirects to Amazon Cognito
proxy_redirect https://$upstream_cognito https://$host;
# Update cookie domain and path
proxy_cookie_domain $upstream_es $host;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
sub_filter $upstream_es $host;
sub_filter_once off;
# Response buffer settings
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
location ~ \/(log|sign|error|fav|forgot|change) {
# use aws dns resolver
resolver 169.254.169.253 valid=30s;
set $upstream_es {es_endpoint};
set $upstream_cognito {cognito_endpoint};
# Forward requests to Cognito
proxy_pass https://$upstream_cognito;
# Handle redirects to Kibana
proxy_redirect https://$upstream_es https://$host;
# Handle redirects to Amazon Cognito
proxy_redirect https://$upstream_cognito https://$host;
# Update cookie domain
proxy_cookie_domain $upstream_cognito $host;
}
}