I am trying to create a Sonarqube in a Ubuntu virtual machine with Vagrant and using Nginx. I have followed all the steps but when I try to access I get a 502 BadGateway
and checking the logs I get the following:
2020/01/29 18:44:05 [alert] 1205#1205: 768 worker_connections are not enough
2020/01/29 18:44:05 [error] 1205#1205: *2090 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: sonarqube.developerinsider.co, request: "GET /favicon.ico HTTP/1.0", upstream: "
This is the configuration I have for the site:
upstream sonar {
server 127.0.0.1:9000;
}
server{
listen 9000;
server_name sonarqube.developerinsider.co;
access_log /var/log/nginx/sonar.access.log;
error_log /var/log/nginx/sonar.error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location / {
proxy_pass http://127.0.0.1:9000;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
}
}
This is my Vagrant File:
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1804"
config.vm.box_check_update = true
config.vm.network "private_network", ip: "XXX.XX.XX.XX"
config.vm.network "forwarded_port", guest: 80, host: 8081, host_ip: "127.0.0.1"
config.vm.hostname = "tracker.tlc.vm"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
end
However I can access the Jenkins I have in it and the Nginx's default site. I try to access using the following IP: http://XXX.XX.XX.XX:9000/