Need NGINX configuration for SSL with self-signed certificate

SonarQube 8.2 with nginx reverse proxy
below is the reverse proxy settings am using

server {

listen 443;

ssl on;
ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/cert.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ‘ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS’;

server_name Sonarqube;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location /{
proxy_pass http://localhost:9000;
proxy_redirect http://localhost:9000 https://localhost:9090;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $https;

      proxy_http_version 1.1;
      proxy_request_buffering off;
     }

}


Am i missing some thing

Am able to browse https but when trying to compile using https with client unable to connect to sonarqube server
But am able to compile using http with port 9000
sonarqube

Can any one help me on this
I need correct nginx config

Update
Below is the nginx logs

Hello @Sharath_Kumar,

Here is a SonarQube community, not an Nginx one. Looking at your Nginx config, I’m puzzled by the server_name entry as usually this is the vhost URL. But anyway I can’t really say much about this.

What’s sure is that the issue you have is your scanner not able to reach SQ. You should first try to reach it using curl and make sure it works before even running the scanner.

Cheers

Thanks for replay,

I was able to solve the issue by importing the self-signed certificate into java keystore.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.