SonarQube on windows, running on http://localhost/9000.
I’m setting up NGINX to use as a reverse proxy and serve on https://localip.com.
I’m getting the following EE when trying to connect to SonarQube
You’re not authorized to access this page. Please contact the administrator. Reason: The response was received at http://localhost:9000/oauth2/callback/saml instead of https://localip.com/oauth2/callback/saml
I’m guessing I need to instruct NGINX to rewrite the callback, how do I do it?
3
Answers
I have same issue, but i run Apache server , and my proxy configuration is as follow:
what solve issue is adding :
You don’t show a sample config, but I recently hit the same issue as you when setting up SonarQube 9 behind an nginx reverse proxy w/ SAML.
The most likely fix for this is to add these 2 lines to your server proxypass section in your nginx proxy config:
Sonarsource had a post about this for IIS reverse proxies, where they indicate 2 important things:
The lines in my above code snippet handle the NGINX equivalents for #1 and #2 in that order.
Their Operating the Server page also gives this sample config:
Based on your error message, the proxy_pass line will most likely something like
proxy_pass http://localhost:9000
. That’s how I set mine up as well.Just go to
https://{sonarqube_domain}/admin/settings
and make sureServer base URL
is set tohttps://{sonarqube_domain}