Gitlab nginx problems - nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

I allready have got nginx on own server and theit config allready bind address. I dotn't want to change 80 port, beacause my server have got websites and users on it.

Gitlab in logs have got errors, that

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

what i must to do? Where and how I can change gitlab nginx config?

Upvotes: 0

Views: 6782

Answers (2)

Zander Wong
Zander Wong

Reputation: 699

as u say, u have 2 ng-instances, so u can't listen the same port using different process at the same time.

here is the choice:

  1. gitlab-ng listen another port, external-ng listen 80 and proxy_pass the gitlab-ng.
  2. stop using external-ng, move ur config of the external-ng to gitlab-ng, using 80/443 port and different domain in gitlab-ng.

Upvotes: -1

BostAxola
BostAxola

Reputation: 66

You can run two server on the same port using nginx:

If you installed gitlab-omnibus and if you want to change the default port:

  1. Open /etc/gitlab/gitlab.rb
  2. Add external_url "http:// domain:NewPort"
  3. Run gitlab-ctl reconfigure

If you have installed gitlab manually locate nginx's folder (you can type whereis nginx on the console) and modify gitlab's file on the sites-available subfolder. Normally the file you have to modify is: /etc/nginx/sites-available/gitlab

Upvotes: 2

Related Questions