From f511882f5714ab873be1bc1b5efd927c541f1a90 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 8 Jan 2022 04:57:30 +0100 Subject: [PATCH] only replace variables that are defined, try to fix nginx template --- deployment/bare_metal/install.sh | 2 +- .../bare_metal/nginx/sites-available/gradido.conf.template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/bare_metal/install.sh b/deployment/bare_metal/install.sh index 933571e7e..dfd8dab7a 100755 --- a/deployment/bare_metal/install.sh +++ b/deployment/bare_metal/install.sh @@ -102,4 +102,4 @@ sudo certbot --certonly # Generate gradido.conf from template # TODO order - first certbot, then nginx setup -envsubst < gradido.conf.template > gradido.conf \ No newline at end of file +envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < gradido.conf.template > gradido.conf \ No newline at end of file diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.template index 2868ac136..cceee1ef5 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.template @@ -1,5 +1,5 @@ -if ($NGINX_SSL = 'true') - server { +server { + if ($NGINX_SSL = 'true') { if ($host = $NGINX_SERVER_NAME) { return 301 https://$host$request_uri; }