Unable to Save Settings when behind Apache Reverse Proxy

150 views
Skip to first unread message

cha...@gmail.com

unread,
Jul 6, 2017, 8:30:03 PM7/6/17
to SonarQube
I recently upgraded SonarQube to 6.4 from an older release. Now when I try and save settings in the General section I am redirected to the login page. I can see in chrome dev tools that I get a 401 to the /sonar/api call that is made when I hit save. When I try and make the same change going directly to sonar:port bypassing the reverse proxy it works. I am using apache2, mod_proxy and doing ssl termination on the proxy server. The Proxy is running on an ubuntu server and sonarqube is on amz linux if it matters. I have tried various combinations of Proxy statements and directives but nothing seems to allow me to make admin changes to sonar via the proxy url. Here are some of the relevant parts of where I have ended up after various searches,

#proxy.conf
        ProxyRequests Off
        ProxyPreserveHost On

        ProxyPass /sonar http://x.x.x.x:9000/sonar
        ProxyPassReverse /sonar https://dev.myhost.io/sonar
        #                                                   ^not 100% sure this is right but saw it somewhere as a suggestions

#ssl.conf
        ServerName dev.myhost.io

        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-Forwarded-Port "443"

        AllowEncodedSlashes     On

Thanks.

danny.g...@gmail.com

unread,
Jul 27, 2017, 4:22:35 AM7/27/17
to SonarQube, cha...@gmail.com
Same problem here.

But if we login on SonarQube with the admin-account it works. The problem raises only with any user-account that is in the sonar-administrators-group. By login with use of the direct URL and port it work also with these user-accounts.

Greetings
Reply all
Reply to author
Forward
0 new messages