Pre-existing nginx configuration issues

Ok, so I managed to figure out one method to do this. Based on this post, it seems like it’s a better idea to make sure that gitlab has a blank canvas, so having a site running on nginx could cause some conflicts.

After a quick discussion on the #networking channel on IRC there seem to be two options:

  1. Either configure that to run on a different port say 81 or whatever floats your boat
  2. enable a reverse proxy so a specific path goes to your gitlab server
    for example: example.com/* goes to your regular webserver while example.com/gitlab/* will reverse proxy into localhost:81 (lets say gitlab is configured to listen at localhost:81 instead of *:81)

For simplicity I went with option 1, namely editing /etc/gitlab/gitlab.rb file to be external_url "https://mysite.com:81" and then reconfigured, restarted gitlab, and then tried starting nginx once more failed because it kept saying that port 80 was in use alread (which didn’t make sense since I just specified it to be port 81).

Though this post revelead the fix, namely removing the old syntax from all of my sites server blocks (had to do each each nginx site config I made). Then restarting nginx one last time works.
And I can run my site as well as gitlab on the same server.

3 Likes