How to setup Gitlab-omnibus with non-bundled web-server?
Solution 1:
Continuing to explore I find the /var/opt/gitlab/
directory and solve this doing:
sudo ln -s /var/opt/gitlab/nginx/conf/gitlab-http.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-{available,enabled}/gitlab-http.conf
sudo service nginx reload
Solution 2:
As for gitlab 8, we cannot symlink to the default gitlab-http.conf anymore because the bundle webserver will not be installed when we set nginx['enable'] = false
.
Just download the right web server configs from GitLab recipes repository and change YOUR_SERVER_FQDN
with
your preferred domain name.
See here for detail instructions on how to install gitlab using non-bundled web-server.
Solution 3:
To ensure that user are accessible your Nginx user (usually www-data or nginx) should be added to the gitlab-www group:
sudo usermod -aG gitlab-www nginx
or
sudo usermod -aG gitlab-www www-data
Solution 4:
If you symlinked gitlab-http.conf and then got :
unknown log format "gitlab_access" in /etc/nginx/sites-enabled/gitlab-http.conf
Just add the log_format
directives from /var/opt/gitlab/nginx/conf/nginx.conf
to your global nginx configuration :
http {
...
log_format gitlab_access '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
log_format gitlab_ci_access '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
log_format gitlab_mattermost_access '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
...
}