"Home page URL" not working in version 8.17.3 with apache2 external webserver- Always redirects to users/sign_in

Summary

As a continuation of #28609 (closed) and #1876 (closed) I want to report that the Home Page URL is still not working if I use apache as web server. As a side note, it is fixed on the instance where I use nginx as web server. Is this not supported?

Steps to reproduce

Install gitlab. configure apache to be the external Webserver. Here is my apache2 vhost configuration with suitably anonymized addresses:

# 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'] = "127.0.0.1:8181"
#
#Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http

<VirtualHost alf.de:80>
  ServerName alf.physik.uni-wuerzburg.de
  ServerSignature Off
  RewriteEngine on
  RewriteCond %{HTTPS} !=on
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
</VirtualHost>


<VirtualHost alf.de:443>
  ServerName alf.de
  ServerSignature Off

  ProxyPreserveHost On

  # Ensure that encoded slashes are not decoded but left in their encoded state.
  # http://doc.gitlab.com/ce/api/projects.html#get-single-project
  AllowEncodedSlashes NoDecode

        SSLEngine on
        SSLProtocol all -SSLv2 -SSLv3
        SSLHonorCipherOrder on
        SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256

        SSLCertificateFile /etc/apache2/ssl.crt/alf.crt
        SSLCertificateKeyFile /etc/apache2/ssl.key/alf.key
        SSLCertificateChainFile /etc/apache2/ssl.crt/chain.pem

  RequestHeader set X-Forwarded-Ssl 'on'


  <Location />
    # New authorization commands for apache 2.4 and up
    # http://httpd.apache.org/docs/2.4/upgrading.html#access
    Require all granted

    #Allow forwarding to gitlab-workhorse
    ProxyPassReverse http://127.0.0.1:8181
    ProxyPassReverse https://alf.de/
  </Location>

  # Apache equivalent of nginx try files
  # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
  # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
  RewriteEngine on

  #Forward all requests to gitlab-workhorse except existing files like error documents
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
  RewriteCond %{REQUEST_URI} ^/uploads/.*
  RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]

  # 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/apache2/alf.de_error.log
  CustomLog /var/log/apache2/alf.de_forwarded.log common_forwarded
  CustomLog /var/log/apache2/alf.de_access.log combined env=!dontlog
  CustomLog /var/log/apache2/alf.de.log combined

</VirtualHost>

What is the current bug behavior?

If I visit example.org I get to see example.org/users/sign_in

What is the expected correct behavior?

If I visit example.org I get to see example.org/Group/project e.g the web site that I have set in the "Home page URL" field of the site settings.

Results of GitLab environment info

System information
System:         SUSE 12.2
Current User:   git
Using RVM:      no
Ruby Version:   2.3.3p222
Gem Version:    2.6.6
Bundler Version:1.13.7
Rake Version:   10.5.0
Redis Version:  3.2.5
Sidekiq Version:4.2.7

GitLab information
Version:        8.17.3
Revision:       f0c970e
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     postgresql
URL:            https://alf.de
HTTP Clone URL: https://alf.de/some-group/some-project.git
SSH Clone URL:  git@alf.de:some-group/some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        4.1.1
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
Hooks:          /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:            /opt/gitlab/embedded/bin/git

Results of GitLab application Check

/opt/gitlab/bin/gitlab-rake gitlab:check SANITIZE=true                                      
Checking GitLab Shell ...                                                                                              
                                                                                                                       
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)                                                                         
Repo base directory exists?                                                                                            
default... yes                                                                                                         
Repo storage directories are symlinks?                                                                                 
default... no                                                                                                          
Repo paths owned by git:git?                                                                                           
default... yes                                                                                                         
Repo paths access is drwxrws---?                                                                                       
default... yes                                                                                                         
hooks directories in repos are links: ...                                                                              
2/1 ... ok                                                                                                             
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check                                                            
Check GitLab API access: OK                                                                                            
Access to /var/opt/gitlab/.ssh/authorized_keys: OK                                                                     
Send ping to redis server: OK                                                                                          
gitlab-shell self-check successful                                                                                     
                                                                                                                       
Checking GitLab Shell ... Finished                                                                                     
                                                                                                                       
Checking Sidekiq ...                                                                                                   
                                                                                                                       
Running? ... yes                                                                                                       
Number of Sidekiq processes ... 1                                                                                      
                                                                                                                       
Checking Sidekiq ... Finished                                                                                          
                                                                                                                       
Checking Reply by email ...                                                                                            
                                                                                                                       
Reply by email is disabled in config/gitlab.yml                                                                        
                                                                                                                       
Checking Reply by email ... Finished                                                                                   
                                                                                                                       
Checking LDAP ...                                                                                                      
                                                                                                                       
LDAP is disabled in config/gitlab.yml                                                                                                                                 
                                                                                                                                                                      
Checking LDAP ... Finished                                                                                                                                            
                                                                                                                                                                      
Checking GitLab ...                                                                                                                                                   
                                                                                                                                                                      
Git configured with autocrlf=input? ... yes                                                                                                                           
Database config exists? ... yes                                                                                                                                       
All migrations up? ... yes                                                                                                                                            
Database contains orphaned GroupMembers? ... no                                                                                                                       
GitLab config exists? ... yes                                                                                                                                         
GitLab config outdated? ... no                                                                                                                                        
Log directory writable? ... yes                                                                                                                                       
Tmp directory writable? ... yes                                                                                                                                       
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)                                                                                            
Init script exists? ... skipped (omnibus-gitlab has no init script)                                                                                                   
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)                                                                                               
projects have namespace: ...                                                                                                                                          
2/1 ... yes                                                                                                                                                           
Redis version >= 2.8.0? ... yes                                                                                                                                       
Ruby version >= 2.1.0 ? ... yes (2.3.3)                                                                                                                               
Your git bin path is "/opt/gitlab/embedded/bin/git"                                                                                                                   
Git version >= 2.7.3 ? ... yes (2.10.2)                                                                                                                               
Active users: 23                                                                                                                                                      
                                                                                                                                                                      
Checking GitLab ... Finished