Hi all,
Sorry for posting this here, but I simply don't understand how to setup a reverse proxy for HTTPS.
I've seen this documentation page (https://docs.sonarqube.org/display/SONAR/Securing+the+Server+Behind+a+Proxy), but it isn't clear to me how to set it up for the Docker implementation.
So I setup a Ubuntu server, installed Docker and followed these steps: https://github.com/SonarSource/docker-sonarqube/blob/master/recipes.md
Now I have SonarQube up and running and I can access it through http://{ server-IP }:9000
But how can I make SonarQube accessible through a custom domainname. So for example: https://sonarqube.example.com
Do I need to install NGINX on Ubuntu, or do I need to change the docker-compose.yml to start an NGINX container?
I don't know if it changes anything, but I use Cloudflare to configure the DNS and to add HTTPS.
I've seen this documentation page (https://docs.sonarqube.org/display/SONAR/Securing+the+Server+Behind+a+Proxy), but it isn't clear to me how to set it up for the Docker implementation.
Now I have SonarQube up and running and I can access it through http://{ server-IP }:9000
But how can I make SonarQube accessible through a custom domainname. So for example: https://sonarqube.example.com
The same way as usage of Nginx to serve https requests for some domain and any other container.
Do I need to install NGINX on Ubuntu, or do I need to change the docker-compose.yml to start an NGINX container?
It's entirely up to you - can do one or another depending on what you want to achieve.
And strictly speaking explanations of Nginx and how to use Docker are off-topic of this bug tracker, but nevertheless below is an example of second way.
docker-compose.yml:
version: "2"
services:
sonarqube:
image: sonarqube
networks:
- sonarnet
nginx:
build:
context: .
dockerfile: Dockerfile.nginx
ports:
- "8080:80"
networks:
- sonarnet
networks:
sonarnet:
driver: bridge
Dockerfile.nginx:
FROM nginx
COPY nginx-sonarqube.conf /etc/nginx/conf.d/sonarqube.conf
nginx-sonarqube.conf:
server {
server_name example.org;
location / {
proxy_pass http://sonarqube:9000;
}
}
and in /etc/hosts I have 127.0.0.1 example.org, so that after docker-compose up I can see SonarQube homepage on http://example.org:8080 as it is proxied via Nginx to SonarQube.
Just wanted to drop by and say that the example posted above was super helpful.
Hi, I keep having an infinite loop with https.
What are the requirement for http vhost ?
Most helpful comment
The same way as usage of Nginx to serve https requests for some domain and any other container.
It's entirely up to you - can do one or another depending on what you want to achieve.
And strictly speaking explanations of Nginx and how to use Docker are off-topic of this bug tracker, but nevertheless below is an example of second way.
docker-compose.yml:Dockerfile.nginx:nginx-sonarqube.conf:and in
/etc/hostsI have127.0.0.1 example.org, so that afterdocker-compose upI can see SonarQube homepage onhttp://example.org:8080as it is proxied via Nginx to SonarQube.