HomeChallengesRepsProblemsLeaderboardTake a challenge

Behind the load balancer

The API now sits behind a load balancer that ends HTTPS and adds a path prefix. Requests redirect to HTTPS forever, every customer shares one rate-limit bucket, and generated links lose /wallet.

Beginner15 min on the clock5 graded checks · 100 pointsWorks on One Server
Graded by reading your code against the checklist below.

What you build

  • Read the client address and scheme from the forwarded headers
  • Apply them before anything that uses the address or the scheme
  • Trust those headers only from the balancer’s network
  • Restore the /wallet path prefix from configuration
  • Place routing after the path base, explicitly

Done means

Forwarded headers applied first and trusted only from the balancer, path base from configuration, routing after it.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. The forwarded headers are configured+20Behind a load balancer
  2. They are applied before redirects and rate limits+20Behind a load balancer
  3. Only the balancer is trusted to send them+20Behind a load balancer
  4. The path prefix is restored+20Behind a load balancer
  5. Routing runs after the path base+20Behind a load balancer

What it teaches

The rest of Works on One Server