Skip to content

Commit

Permalink
[New] Support replacement of backend for development in internal-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Nov 13, 2024
1 parent f4aad3c commit f4884a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions deploy/internal-auth/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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_RECORD_MANAGER_SERVER_SERVICE=http://host.docker.internal:8080
# 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
4 changes: 4 additions & 0 deletions deploy/internal-auth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ services:
APP_ROOT_PATH: "${APP_ROOT_PATH:-}"
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
- ../shared/nginx/error.html:/usr/share/nginx/html/error.html:ro
Expand Down
11 changes: 8 additions & 3 deletions deploy/internal-auth/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ http {
}

location /services/record-manager-server/ {
proxy_pass http://record-manager-server:8080/record-manager/; # keep the trailing slash to cut off matched prefix
proxy_pass ${INTERNAL_RECORD_MANAGER_SERVER_SERVICE}/record-manager/; # keep the trailing slash to cut off matched prefix
proxy_cookie_path /record-manager ${APP_ROOT_PATH}/services;
}

Expand All @@ -61,16 +61,21 @@ 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/ {
proxy_pass http://s-pipes-engine:8080/; # keep the trailing slash to cut off matched prefix
}

location ${ANALYTICS_PATH} {
location ${ANALYTICS_PATH} {
try_files /statistics.html =404;
root /usr/share/nginx/html;
}
}

location /health-check {
return 200;
Expand Down

0 comments on commit f4884a3

Please sign in to comment.