Installing the web server
Now that we have installed GitLab CI, we still need a way to expose it to the Internet. This is where Nginx comes into play. In this recipe, we will take a look at how you can set up Nginx to proxy the request back to your GitLab CI app. It is also possible to use another web server such as Apache here, but Nginx is recommended.
How to do it…
In the following steps, we will install the web server:
Log in via SSH to your CI server.
Install Nginx:
$ sudo apt-get install nginx
Next, we have to copy the example site configuration over to the Nginx-enabled sites:
$ sudo cp /home/gitlab_ci/gitlab-ci/lib/support/nginx/gitlab_ci /etc/nginx/sites-enabled/gitlab_ci
We still have to change a few things in the configuration file that we just copied. Change the
default_server
address to the IP address of your server, and change theserver_name
value to the full domain name of your GitLab CI server:$ sudo editor /etc/nginx/sites-enabled/gitlab_ci
Check whether the Nginx configuration...