I know about this similar question, but I can't seem to fix my issue reading through it.
Background
I am trying to run Chronograf via Nginx. I already have a few Nginx block running.
For this one, I follow the example here, so I set up the following file in this location: /etc/nginx/sites-available/chronograf.baseurl.com
:
server {
server_name chronograf.baseurl.com www.chronograf.baseurl.com;
location / {
proxy_pass http://localhost:8888/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Then I check the syntax with sudo nginx -t
and see that all is good:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Finally I run sudo systemctl restart nginx
and get a failure:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
The /var/log/nginx/error.log
posts:
2020/05/27 02:22:27 [info] 4740#4740: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:80 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:443 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:80 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:443 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:80 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:443 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:80 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:443 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:80 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: bind() to 0.0.0.0:443 failed (98: Address already in use)
2020/05/27 02:22:27 [emerg] 4751#4751: still could not bind()
Can someone help me debug this?
UPDATE 1
As per the @Pandurang's suggestion:
- I stopped
nginx
by runningsudo systemctl stop nginx
. - Then I run the
ps -ef | grep nginx
command.
It returns the following output:
root 846 821 0 Apr13 ? 00:45:11 runsv nginx
root 870 846 0 Apr13 ? 00:47:39 svlogd -tt /var/log/gitlab/nginx
stelian 3028 2943 0 15:47 pts/0 00:00:00 grep --color=auto nginx
root 32462 846 0 01:47 ? 00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 32493 32462 0 01:47 ? 00:00:00 nginx: worker process
gitlab-+ 32494 32462 0 01:47 ? 00:00:00 nginx: worker process
gitlab-+ 32495 32462 0 01:47 ? 00:00:00 nginx: worker process
gitlab-+ 32496 32462 0 01:47 ? 00:01:18 nginx: worker process
gitlab-+ 32497 32462 0 01:47 ? 00:00:00 nginx: cache manager process
I suspect there is a clash between nginx and GitLab?
killall nginx
and test.nginx: no process found
. Theps -ef | grep nginx
still yield the same as shown in my post above.chronograf.baseurl.com
. I getJob for nginx.service failed because the control process exited with error code.