502.3 Bad gateway error when using IIS as reverse proxy with destination as sonarqube on localhost

We have installed sonarqube version sonarqube-9.9.3.79811 and is running on localhost:900 on a windows server EC2 instance.
To enable SSL we have configured IIS reverse proxy with URL rewrite and ARR module configured and URL rewrite rule pointing to http://sonarcube.localhost:9000/{R**:**1}.

We have followed this document to do the exact configuration Operating the server

In the site bindings we have selected https on port 443 and given the SSL certificate as well.
There are 2 things here-

  1. If we go by official sonar doc shared above(without adding anything in host file) we get URL took too long to respond error in the browser.
  2. If we add the 127.0.0.0 Our DNS name entry in the host file we get this 502.3 Bad gateway error.

Detailed logs -

HTTP Error 502.3 - Bad Gateway
The server name or address could not be resolved

Most likely causes:
The CGI application did not return a valid set of HTTP errors.
A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

Things you can try:
Use DebugDiag to troubleshoot the CGI application.
Determine if a proxy or gateway is responsible for this error.

We have tried to tweak a lot of things by reading various forums but no solution in sight.
Can someone help us with this ? We are stuck due to this issue.

Hi,

Welcome to the community!

Check your $SONARQUBE-HOME/logs/access.log to see if SonarQube even got the request. If not, this is a proxy problem, and you’ll want to look at the IIS logs.

Unfortunately, we’re not proxy experts, so this may be as far as we can be helpful.

 
Ann