简体   繁体   English

Sonarqube 后面 nginx 反向代理重定向项目页面不是登录页面

[英]Sonarqube behind nginx reverse proxy redirect projects page not login page

I have an sonarqube inside a docker container and nginx in the server.我在 docker 容器中有一个 sonarqube ,在服务器中有 nginx 。 My nginx.conf我的 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.当我 go 到“sonarqube.mydomain.com”时,它重定向到“sonarqube.mydomain.com/projects”而不是登录页面。 How can i direct to login page when we go to "sonarqube.mydomain.com"?当我们 go 到“sonarqube.mydomain.com”时,我如何直接进入登录页面?

Maybe the documentation will help you.也许文档会对您有所帮助。

I figure out the issue.我弄清楚了这个问题。 In settings of sonarquube force user authentication should be the true.在 sonarqube 的设置中强制用户身份验证应该是 true。 That's why its direct to the projects page.这就是为什么它直接到项目页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM