I installed GitLab from sources and configured nginx to serve the gitlab interface at the url https://gitlab.mydomain.com.
It is all working but if I am logged in and visit the root page (just gitlab.mydomain.com), it shows up an 404 error.
As I found out while searching in the production.log file, nginx tries to serve an index.html page which is (obviously) not available.
Here is my current config for nginx, I also tried it with @gitlab instead of @gitlab-workhorse (a different socket), with no success…:
The .well-known location is only for letsencrypt, that should not be a problem I think. If it is helpful for solving my problem, I am using Plesk Onyx for webhosting and configuration, but I disabled all default things so that my config is working properly.
I have the following setup (Menu entry Apache & nginx settings):
Common Apache settings --> everything default, “Restrict the ability to follow symbolic links” unchecked
nginx settings --> only “Proxy mode” checked
Additional nginx directives:
location ^~ /.well-known {
root /var/www/vhosts/example.org/gitlab.example.org;
}
location ~ / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
# for manual installation
root /home/git/gitlab/public;
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab-workhorse;
}
I have this in my /etc/nginx/conf.d/gitlab.conf:
upstream gitlab {
# for manual installation
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
upstream gitlab-workhorse {
# for manual installation
server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket;
}
Gitlab is working with those settings. If you have further questions or errors, feel free to ask me