From 0298b0fb10578df444ed2f901e23fb124d094955 Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Mon, 25 Jul 2022 11:24:05 +0200 Subject: [PATCH] feat: proxy requests to obwatcher --- standalone/nginx/default.conf | 21 +++++++++++++++++++++ standalone/supervisor-conf/ob-watcher.conf | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/standalone/nginx/default.conf b/standalone/nginx/default.conf index 1415fcb..d96ae84 100644 --- a/standalone/nginx/default.conf +++ b/standalone/nginx/default.conf @@ -11,6 +11,12 @@ upstream jmwalletd_ws_backend { keepalive 2; } +upstream obwatch_backend { + zone upstreams; + server 127.0.0.1:62601; + keepalive 2; +} + server { listen 80; listen [::]:80; @@ -70,4 +76,19 @@ server { proxy_pass https://jmwalletd_ws_backend/; } + + location /obwatch/ { + include /etc/nginx/snippets/proxy-params.conf; + + proxy_http_version 1.1; + proxy_set_header Connection ""; + + # allow 5 min (default is 60 sec). increase on demand. + proxy_read_timeout 300s; + # allow 5 min to connect (default is 60 sec) + proxy_connect_timeout 300s; + + # must proxy via "http" as ob-watcher does not make use of self-signed cert yet + proxy_pass http://obwatch_backend/; + } } diff --git a/standalone/supervisor-conf/ob-watcher.conf b/standalone/supervisor-conf/ob-watcher.conf index c816ada..318b2e0 100644 --- a/standalone/supervisor-conf/ob-watcher.conf +++ b/standalone/supervisor-conf/ob-watcher.conf @@ -1,6 +1,6 @@ [program:ob-watcher] directory=/src/scripts/obwatch -command=python ob-watcher.py --host 0.0.0.0 +command=python ob-watcher.py --host=127.0.0.1 autostart=false stdout_logfile=/root/.joinmarket/logs/obwatch_stdout.log stdout_logfile_maxbytes=5MB