commit e6ef6dd78416691a5ec286e52da5d466dd49d3d9
parent db2490aef2993025b88b6ce8704bfeff327200d8
Author: Florian Dold <florian@dold.me>
Date: Wed, 12 Apr 2023 15:13:37 +0200
netzbon: also handle http
Diffstat:
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/netzbon/config_launch_libeufin.sh b/netzbon/config_launch_libeufin.sh
@@ -48,8 +48,7 @@ fi
# TODO: add sanity-checks for presence of other required env-vars
-if test ${ENABLE_TLS:-} == "y"
-then
+if test ${ENABLE_TLS:-} == "y"; then
PROTO="https"
else
PROTO="http"
diff --git a/netzbon/config_nginx.sh b/netzbon/config_nginx.sh
@@ -2,7 +2,15 @@
source functions.sh
source config/user.conf
-export DOMAIN_NAME=${DOMAIN_NAME}
+
+if test "${ENABLE_TLS:-}" == "y"; then
+ PROTO="https"
+else
+ PROTO="http"
+fi
+
+export PROTO
+export DOMAIN_NAME
envsubst <nginx-conf/backend.taler-nginx.conf >/etc/nginx/sites-available/backend.${DOMAIN_NAME}
envsubst <nginx-conf/bank.taler-nginx.conf >/etc/nginx/sites-available/bank.${DOMAIN_NAME}
diff --git a/netzbon/nginx-conf/backend.taler-nginx.conf b/netzbon/nginx-conf/backend.taler-nginx.conf
@@ -7,9 +7,8 @@ server {
location / {
proxy_pass http://unix:/var/run/taler/merchant-httpd/merchant-http.sock;
- proxy_set_header X-Forwarded-Proto "https";
+ proxy_set_header X-Forwarded-Proto "${PROTO}";
proxy_set_header X-Forwarded-Host "backend.${DOMAIN_NAME}";
proxy_set_header X-Forwarded-Prefix /;
}
-
}
diff --git a/netzbon/nginx-conf/bank.taler-nginx.conf b/netzbon/nginx-conf/bank.taler-nginx.conf
@@ -10,7 +10,7 @@ server {
location /demobanks/default {
proxy_pass http://localhost:5016;
#Fixes withdrawal http request
- proxy_set_header X-Forwarded-Proto "https";
+ proxy_set_header X-Forwarded-Proto "${PROTO}";
proxy_set_header X-Forwarded-Host "bank.${DOMAIN_NAME}";
proxy_set_header X-Forwarded-Prefix /;
}