Hey there.
This user faced a similar issue with Azure Application Gateway
I believe they solved it by making sure the hostname was picked up from the backend address (Azure Application Gateway HTTP settings configuration | Microsoft Learn). You might also find the documentation on Host name preservation useful.
Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported.