From 1059f5c675c59ce3b211f63e01c46935920bd480 Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Thu, 5 Nov 2020 20:49:18 -0700
Subject: [PATCH] Update proxy_redirect, revert service map for additional urls

---
 scripts/custom.config.sh | 6 +-----
 scripts/custom.funcs.sh  | 4 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/scripts/custom.config.sh b/scripts/custom.config.sh
index 60f143f62..fc96e1983 100644
--- a/scripts/custom.config.sh
+++ b/scripts/custom.config.sh
@@ -2,11 +2,7 @@
 export SITE_URL="${SITE_URL_PREFIX}geomag${SITE_URL_SUFFIX}";
 export BASE_HREF=${BASE_HREF:-ws};
 export SERVICE_MAP=(
-  "/ws/docs:web"
-  "/ws/data:web"
-  "/ws/elements:web"
-  "/ws/metadata:web"
-  "/ws/observatories:web"
+  "/${BASE_HREF}:web"
 );
 # Algorithms Environment Variables
 export DATA_HOST=${DATA_HOST:-cwbpub.cr.usgs.gov};
diff --git a/scripts/custom.funcs.sh b/scripts/custom.funcs.sh
index 23a8f9730..eced92e72 100644
--- a/scripts/custom.funcs.sh
+++ b/scripts/custom.funcs.sh
@@ -52,8 +52,8 @@ updateRouting () {
         proxy_set_header X-Client-IP \$remote_addr;
         proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto https;
-        # clean up any redirects sent by proxy
-        proxy_redirect http://\$proxy_host${path} https://\$host${path};
+        # keep redirects on https
+        proxy_redirect http://\$host:\$port https://\$host;
       }
 		EO_SERVER_SNIP
     # ^^ Note: TAB indentation required
-- 
GitLab