I have an sonarqube inside a docker container and nginx in the server. My nginx.conf
upstream sonarqube {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
listen 80;
server_name sonarqube.mydomain.com;
return 301 https://$host$request_uri;
}
server{
server_name sonarqube.mydomain.com;
listen 443 ssl;
ssl_certificate /etc/ssl/certificates/server.crt;
ssl_certificate_key /etc/ssl/certificates/server.key;
access_log /var/log/nginx/sonarqube.access.log;
error_log /var/log/nginx/sonarqube.error.log;
location / {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://sonarqube;
# Required for new HTTP-based CLI
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off; # Required for HTTP-based CLI to work over SSL
}
}
When I go to "sonarqube.mydomain.com" its redirect to "sonarqube.mydomain.com/projects" not login page. How can i direct to login page when we go to "sonarqube.mydomain.com" ?
I figure out the issue. In settings of sonarquube force user authentication should be the true. That's why its direct to the projects page.