From 7b4abf66a090c24f9a3f3b77b89dc06ca961054b Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Fri, 14 Dec 2018 21:36:18 +0100 Subject: [PATCH] Add some monitoring to EDDN status --- contrib/monitor/index.html | 66 ++++++++++++++++++++++++++++++++++++++ contrib/nginx-eddn.conf | 60 +++++++++++++++++++++++++--------- 2 files changed, 110 insertions(+), 16 deletions(-) diff --git a/contrib/monitor/index.html b/contrib/monitor/index.html index 6fae88d..5de73bd 100644 --- a/contrib/monitor/index.html +++ b/contrib/monitor/index.html @@ -19,6 +19,7 @@ +
@@ -37,6 +38,7 @@ +
+
+
+

Server monitoring

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/contrib/nginx-eddn.conf b/contrib/nginx-eddn.conf index 9b28f3f..8f34977 100644 --- a/contrib/nginx-eddn.conf +++ b/contrib/nginx-eddn.conf @@ -4,46 +4,74 @@ server { listen 80; server_name eddn.edcd.io eddn-status.elite-markets.net; - + return 301 https://eddn.edcd.io$request_uri; } server { listen 443 ssl default_server; server_name eddn.edcd.io; - + charset utf8; gzip on; - + root /home/EDDN/contrib/monitor; index index.html; - + ssl_certificate /etc/letsencrypt/live/eddn.edcd.io/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/eddn.edcd.io/privkey.pem; - + location ~ "^/schemas/(.*)/([\d]{1})(/test)?$" { add_header Content-Type application/json; alias /home/EDDN/schemas/$1-v$2.0.json; } + + location = /netdata { + return 301 /netdata/; + } + + location ~ /netdata/(?.*) { + proxy_redirect off; + proxy_set_header Host $host; + + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_http_version 1.1; + proxy_pass_request_headers on; + proxy_set_header Connection "keep-alive"; + proxy_store off; + proxy_pass http://netdata/$ndpath$is_args$args; + + gzip on; + gzip_proxied any; + gzip_types *; + } +} + +# NETDATA UPSTREAM +upstream netdata { + server 127.0.0.1:19999; + keepalive 64; } # GATEWAY UPSTREAM -upstream gateway { - server 127.0.0.1:8081 fail_timeout=0; +upstream gateway { + server 127.0.0.1:8081 fail_timeout=0; } -server { - listen 4430 ssl; +server { + listen 4430 ssl; server_name eddn.edcd.io; - location / { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - - proxy_pass https://gateway; + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + + proxy_pass https://gateway; } - + ssl_certificate /etc/letsencrypt/live/eddn.edcd.io/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/eddn.edcd.io/privkey.pem; } \ No newline at end of file