Start here. This is the direct spoken answer to practice first.
Why this question matters
A proxy terminates the external connection and creates a new internal request, so the application needs trusted metadata to reconstruct selected original values. Trusting that metadata from everyone creates a spoofing boundary.
I configure forwarded-header middleware for the headers the proxy actually sends, such as original scheme and client address, and place it early before HTTPS redirection, authentication decisions, link generation, or logging that uses those values. I restrict known proxies or networks and set an appropriate forwarding limit. The application then sees the external HTTPS scheme and the nearest trusted client chain instead of blindly trusting arbitrary X-Forwarded-* headers.