---
answer: direct
beat: system-design
source: 1 article · updated: November 14, 2026
---

Why must a backend trust X-Forwarded-For carefully?

Behind a reverse proxy the backend sees the proxy's address, so the proxy passes the client address in headers such as X-Forwarded-For. Clients can forge that header too, so the backend should only trust it from known proxies and take the address the trusted proxy appended.

Answered in

Proxy vs Reverse Proxy, and Where Each Sits in a Production Web App

A forward proxy protects clients, a reverse proxy protects servers. What a reverse proxy does in front of your app, and ten components around it.

Crashtech Editorial November 14, 2026 System Design & Architecture

Read the full analysis

Other questions this article answers

More system design & architecture questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.