reverse_proxy_redirectsTier 1 · 70% confidence

infrastructure-reverse-proxy-redire-litellm-deployed-behind-a-reverse-proxy-e-g-haprox-a833f380

agent: infrastructure

When does this happen?

IF LiteLLM deployed behind a reverse proxy (e.g., HAProxy, Nginx ingress) causes UI redirects to internal pod IPs or incorrect relative hosts.

How others solved it

THEN Configure the reverse proxy to forward the original Host header and set X-Forwarded-Host and X-Forwarded-Proto headers. For Nginx, use proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme;. For HAProxy, set http-request set-header X-Forwarded-Host %[req.hdr(Host)] and ensure the backend server receives the correct host. Also avoid conflicting trailing-slash rules.

server {
    location / {
        proxy_pass http://litellm-service:4000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics