From 3366ab1fa402c48475c0b452f1f7fe9056f5781f Mon Sep 17 00:00:00 2001 From: Thomas Schaffter Date: Tue, 17 Dec 2024 01:14:06 +0000 Subject: [PATCH] Fix Caddy redirection rules --- apps/openchallenges/apex/Caddyfile | 5 +++++ docker/openchallenges/services/apex.yml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/openchallenges/apex/Caddyfile b/apps/openchallenges/apex/Caddyfile index 7d196d094..f6a1a8f95 100644 --- a/apps/openchallenges/apex/Caddyfile +++ b/apps/openchallenges/apex/Caddyfile @@ -4,6 +4,8 @@ } handle_path /api* { + // Since handle_path removes the /api prefix, we add it back here manually. + rewrite * /api{uri} reverse_proxy {env.API_GATEWAY_HOST}:{env.API_GATEWAY_PORT} } @@ -17,6 +19,9 @@ } handle_path /zipkin* { + // Since handle_path removes the /zipkin prefix, we add it back here manually. + // Note: Zipkin's root path (/) automatically redirects to /zipkin. + // This configuration avoids unnecessary redirection by forwarding the request directly. rewrite * /zipkin{uri} reverse_proxy {env.ZIPKIN_HOST}:{env.ZIPKIN_PORT} } diff --git a/docker/openchallenges/services/apex.yml b/docker/openchallenges/services/apex.yml index 606beecbd..20f44307e 100644 --- a/docker/openchallenges/services/apex.yml +++ b/docker/openchallenges/services/apex.yml @@ -5,8 +5,8 @@ services: restart: always env_file: - ../../../apps/openchallenges/apex/.env - # volumes: - # - ../../../apps/openchallenges/apex/Caddyfile:/etc/caddy/Caddyfile + volumes: + - ../../../apps/openchallenges/apex/Caddyfile:/etc/caddy/Caddyfile networks: - openchallenges ports: