diff --git a/deploy/keycloak-auth/.env b/deploy/keycloak-auth/.env index 296a948d..19b7aee1 100644 --- a/deploy/keycloak-auth/.env +++ b/deploy/keycloak-auth/.env @@ -21,5 +21,6 @@ RECORD_MANAGER_APP_TITLE=Record Manager APP_LANGUAGE=en -# Internal address where record manager server runs which should be accessible from inside of docker. Use `http://host.docker.internal` to access http://localhost of the host computer. +# Internal address where record manager server runs which should be accessible from inside of docker. To access http://localhost of the host computer use value "http://host.docker.internal". +# See "extra-hosts" within docker-compose file for more info. #INTERNAL_RECORD_MANAGER_SERVER_SERVICE=http://host.docker.internal:8080 diff --git a/deploy/keycloak-auth/docker-compose.yml b/deploy/keycloak-auth/docker-compose.yml index f038a7c2..17d283b8 100644 --- a/deploy/keycloak-auth/docker-compose.yml +++ b/deploy/keycloak-auth/docker-compose.yml @@ -32,6 +32,8 @@ services: RECORD_MANAGER_PATH: "${RECORD_MANAGER_PATH:-/record-manager}" ANALYTICS_PATH: "${ANALYTICS_PATH:-/statistics}" INTERNAL_RECORD_MANAGER_SERVER_SERVICE: "${INTERNAL_RECORD_MANAGER_SERVER_SERVICE:-http://record-manager-server:8080}" + extra_hosts: + - "host.docker.internal:host-gateway" # support "http://host.docker.internal" for Linux (Windows/Mac works without it) volumes: - ./nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template:ro diff --git a/deploy/keycloak-auth/nginx/nginx.conf b/deploy/keycloak-auth/nginx/nginx.conf index e7f0c0bd..d45492bb 100644 --- a/deploy/keycloak-auth/nginx/nginx.conf +++ b/deploy/keycloak-auth/nginx/nginx.conf @@ -61,6 +61,11 @@ http { location /services/db-server/ { proxy_pass http://db-server:7200/; # keep the trailing slash to cut off matched prefix + + proxy_set_header Host $host; + + # Ensure Location headers are rewritten properly as X-Forwarded-Port is ignored + proxy_redirect http://localhost/ ${APP_ORIGIN}/services/db-server/; } location /services/s-pipes/ {