summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-12 15:13:37 +0200
committerFlorian Dold <florian@dold.me>2023-04-12 15:13:37 +0200
commite6ef6dd78416691a5ec286e52da5d466dd49d3d9 (patch)
tree14f173c8a22241242d9195004e93474b99390df4
parentdb2490aef2993025b88b6ce8704bfeff327200d8 (diff)
downloaddeployment-e6ef6dd78416691a5ec286e52da5d466dd49d3d9.tar.gz
deployment-e6ef6dd78416691a5ec286e52da5d466dd49d3d9.tar.bz2
deployment-e6ef6dd78416691a5ec286e52da5d466dd49d3d9.zip
netzbon: also handle http
-rwxr-xr-xnetzbon/config_launch_libeufin.sh3
-rwxr-xr-xnetzbon/config_nginx.sh10
-rw-r--r--netzbon/nginx-conf/backend.taler-nginx.conf3
-rw-r--r--netzbon/nginx-conf/bank.taler-nginx.conf2
4 files changed, 12 insertions, 6 deletions
diff --git a/netzbon/config_launch_libeufin.sh b/netzbon/config_launch_libeufin.sh
index 2cb6e61..a7f7c91 100755
--- 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
index b803c43..8f7764c 100755
--- 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
index b0c990c..cc2520d 100644
--- 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
index 6216efe..7cb1b3b 100644
--- 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 /;
}