Repository navigation
Expand file tree
/
Copy pathmonitoring.plusclouds.com.conf
More file actions
84 lines (72 loc) · 2.9 KB
/
Copy pathmonitoring.plusclouds.com.conf
File metadata and controls
84 lines (72 loc) · 2.9 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
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
78
79
80
81
82
83
84
# OpenResty / nginx site for the monitoring engine API, terminating TLS in
# front of deploy/compose. Install as
# /etc/openresty/sites-enabled/monitoring.plusclouds.com
# then: openresty -t && systemctl reload openresty
#
# On the monitoring host, in deploy/compose/.env:
# MONITOR_PUBLIC_URL=https://monitoring.plusclouds.com
# MONITOR_API_BIND=<the host's private IP, e.g. 10.128.0.210>
# and allow ports 8443 and 9443 on that IP from this proxy only (firewall).
upstream monitoring {
# The monitoring host's private IP and MONITOR_API_PORT.
server 10.128.0.210:8443;
keepalive 32;
}
upstream monitoring_ingest {
# The same host and MONITOR_INGEST_PORT (HTTP push, from v0.9.0).
server 10.128.0.210:9443;
keepalive 32;
}
server {
listen 80;
server_name monitoring.plusclouds.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name monitoring.plusclouds.com;
ssl_certificate /etc/letsencrypt/live/plusclouds.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/plusclouds.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
# access_log syslog:server=10.128.0.200:13000,facility=local7,tag=monitoring,nohostname,severity=info graylog2_json;
# error_log syslog:server=10.128.0.200:13000,facility=local7,tag=monitoring,severity=error warn;
# API clients only; nothing here should be cached or framed.
add_header Strict-Transport-Security "max-age=31536000" always;
add_header X-Content-Type-Options nosniff always;
# The engine refuses bodies over api.max_body (4 MiB) itself; stop
# larger ones here first.
client_max_body_size 4m;
# Shared proxy settings.
proxy_http_version 1.1;
proxy_set_header Connection ""; # keep upstream connections alive
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
# One ID in both logs; the engine echoes it in X-Request-ID and in errors.
proxy_set_header X-Request-ID $request_id;
proxy_redirect off;
location / {
proxy_pass http://monitoring;
proxy_connect_timeout 5s;
# Above the engine's own request timeout (api.request_timeout, 90 s).
proxy_read_timeout 120s;
proxy_send_timeout 120s;
}
# HTTP push from devices (F08, from v0.9.0). The engine limits bodies to
# ingest.http.max_body (64 KiB) and rates per check itself.
location /ingest/ {
proxy_pass http://monitoring_ingest;
client_max_body_size 128k;
proxy_connect_timeout 5s;
proxy_read_timeout 40s;
}
# Server-sent event stream (from M2): unbuffered and long-lived.
location = /v1/events {
proxy_pass http://monitoring;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 1h;
proxy_send_timeout 1h;
}
}