Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »


Official SonarQube Doc Link: Securing the Server Behind a Proxy

This section helps you configure the SonarQube Server if you want to run it behind a proxy. This can be done for security concerns or to consolidate multiple disparate applications.

Table of Contents


서버 설정

SonarQube 서버를 HTTPS 프로토콜 상에서 실행하기 위해서는 표준적인 리버스 프록시 인프라스트럭처를 만들어야 합니다. 리버스 프록시는 모든 HTTP 요청 헤더에서  \"X\_FORWAREDED\_PROTO: https:\" 설정되어야 합니다. 속성이 없는 경우, SonarQube에서 보내는 리다이렉션은 HTTP 떨어집니다.

아파치 프록시 사용하기

다음의 상황을 가정합니다:

www.public\_sonar.com virtual host HTTPd 환경 설정 파일을 수정합니다. 다음 내용을 포함시켜 SonarQube mod\_proxy 통해 http://www.public\_sonar.com/ 접근할 있도록 합니다:

ProxyRequests Off
ProxyPreserveHost On
<VirtualHost *:80>
  ServerName www.public_sonar.com
  ServerAdmin admin@somecompany.com
  ProxyPass / http://private_sonar_host:sonar_port/
  ProxyPassReverse / http://www.public_sonar.com/
  ErrorLog logs/somecompany/sonar/error.log
  CustomLog logs/somecompany/sonar/access.log common
</VirtualHost>


Apahce 환경 설정은 여러분이 사용하는 어플리케이션의 요구사항과, SonarQube를 외부로 노출시키기 원하는 방법에 따라 달라질 수 있습니다. Apache HTTPd와 mod_proxy에 대한 세부적인 내용은 http://httpd.apache.org를 참조합니다.

Nginx 사용하기

다음의 상황을 가정합니다:

Nginx 환경 파일을 수정합니다. http://www.somecompany.com/ 통해 SonarQube 접근하기 위해 다음 내용을 추가합니다.

# the server directive is nginx's virtual host directive
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 80;

  # sets the domain[s] that this vhost server requests for
  server_name www.somecompany.com;

  location / {
    proxy_pass http://sonarhost:sonarport;
  }
}


Nginx 환경 설정은 여러분의 어플리케이션 요구사항, SonarQube 외부로 노출시키기 원하는 방법에 따라 달라질 있습니다. Nginx 관련된 세부적인 내용은 

https://www.nginx.com/resources/admin-guide/reverse-proxy/ 참조합니다.

Sonarqube 2048 이상의 URL 요청하는 경우가 있으므로 max URL length 증가해야 수도 있습니다.

IIS 사용하기

http://blog.jessehouwing.nl/2016/02/configure-ssl-for-sonarqube-on-windows.html를 참조합니다.

  • No labels