Best way to handle HTTP redirects within the cluster?

Hi @Kyle_Flavin ,

Thanks for asking. It’s a very common use case, and here is a better way to do this than updating your cluster ingresses.

You can inspire yourself from this thread:

The idea is to deploy an NGINX or Caddy (recommended) container in front of your application to redirect the traffic the way you want.

The caddy configuration could be something like this:

http:// {
        reverse_proxy /other-path/* https://your-old-app.domain.tld
        reverse_proxy /* http://{$FRONTEND_HOST}:8000

:warning: Note: FRONTEND_APP is an environment variable that you have defined in the Qovery environment variable. {$FRONTEND_APP} is the Caddy syntax to declare an environment variable.


  • This is a much better and simpler way than modifying the NGINX ingress controller on your Kubernetes controller.
  • There is no risk that the configuration breaks in case of a Kubernetes upgrade
  • The container can be scaled the way you want - it’s stateless
  • You can version (GitOps) the caddy configuration into Git :slight_smile:
1 Like