Yes, the problem is the most likely misconfiguration of your application gateway. I wasn't clear with the X-Forwarded-For. There are several headers every reverse proxy needs to send so the backend app can work properly.
https://requestly.com/blog/what-are-x-forwarded-headers-and-why-it-is-used/
The X-Forwarded-For should contain the client IP and the X-Forwarded-Host the original host. The correct X-Forwarded-Host should primarily help.