Forwarded Headers Are Not Trusted Input: X-Forwarded-For, Proto and Host Behind a Tunnel
When you put an app behind a tunnel, three request headers start deciding what your code believes. X-Forwarded-For says who is calling, X-Forwarded-Proto says whether the request was HTTPS, and X-Forwarded-Host says which hostname the caller asked for.