Installation of Gitlab + Apache in a subdomain shows always Gitlab for any URL


I have an installation of CentOS 6.8 + Gitlab CE 8.9.1 and Gitlab works, but when going to any site (or the root) of the Apache server always shows the Gitlab login page.

I’ve tried everything found with the Gitlab apache conf that i found searching the internet but unable to get it work.

I mean, if for example the server is: subdomain.domain.tld and Gitlab is under git.subdomain.domain.tld, if i go:

git.subdomain.domain.tld i get the Gitlab login page (As expected)
subdomain.domain.tld i get the Gitlab login page (instead of the http server root)
subdomain.domain.tld/egroupware i get the Gitlab login page (instead of the eGroupware page)
subdomain.domain.tld/some_random_chars i get the Gitlab login page (instead the error page)

My Apache conf file for this is:

# This configuration has been tested on GitLab 8.2
# Note this config assumes unicorn is listening on default port 8080 and
# gitlab-workhorse is listening on port 8181. To allow gitlab-workhorse to
# listen on port 8181, edit /etc/gitlab/gitlab.rb and change the following:
# gitlab_workhorse['listen_network'] = "tcp"
# gitlab_workhorse['listen_addr'] = ""
#Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http
<VirtualHost *:80>
  ServerName git.subdomain.domain.tld
  ServerSignature Off

  ProxyPreserveHost On

  # Ensure that encoded slashes are not decoded but left in their encoded state.
  AllowEncodedSlashes NoDecode

  <Location />
    Order deny,allow
    Allow from all

    #Allow forwarding to gitlab-workhorse
    ProxyPassReverse http://git.subdomain.domain.tld/

  # Apache equivalent of nginx try files
  RewriteEngine on

  #Don't escape encoded characters in api requests
  RewriteCond %{REQUEST_URI} ^/api/v3/.*
  RewriteRule .*{REQUEST_URI} [P,QSA,NE]

  #Forward all requests to gitlab-workhorse except existing files like error documents
  RewriteCond %{REQUEST_URI} ^/uploads/.*
  RewriteRule .*{REQUEST_URI} [P,QSA]

  # needed for downloading attachments
  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

  #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
  ErrorDocument 404 /404.html
  ErrorDocument 422 /422.html
  ErrorDocument 500 /500.html
  ErrorDocument 502 /502.html
  ErrorDocument 503 /503.html

  # It is assumed that the log directory is in /var/log/httpd.
  # For Debian distributions you might want to change this to
  # /var/log/apache2.
  LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
  ErrorLog /var/log/httpd/git.subdomain.domain.tld.log
  CustomLog /var/log/httpd/git.subdomain.domain.tld.log common_forwarded
  CustomLog /var/log/httpd/git.subdomain.domain.tld.log combined env=!dontlog
  CustomLog /var/log/httpd/git.subdomain.domain.tld.log combined


Do anyone knows how to solve this? I’ve done all my best but unable to resolve.


How does your gitlab.rb look

I have some trouble myself with that.
But I needed to turn off Nginx adding this here to gitlab.rb

nginx[‘enable’] = false


Thanks by your answer, but i already have

nginx[‘enable’] = false

Note the problem is that when i access any subdomain (or the main domain) it always shows the gitlab login page

I have gitlab in git.subdomain.domain.tld and i always get the gitlab login page even i access (for example):


If I didn’t know any better, then I would think that you used ISPConfig3 together with Gitlab.
Doing that myself, and I have the gitlab and all the other sites running.

But my problem is, that I cannot download any projects. Only get a empty archive.