Skip to content

Commit

Permalink
Fix Caddy redirection rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter committed Dec 17, 2024
1 parent 5681e28 commit 3366ab1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apps/openchallenges/apex/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand All @@ -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}
}
Expand Down
4 changes: 2 additions & 2 deletions docker/openchallenges/services/apex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3366ab1

Please sign in to comment.