I set up gitlab on my personal server and used this answer and this answer (along with some input from this to make it work with my apache installation. Everything works fine, when I go to gitlab.example.com, I see the gitlab UI, can create accounts and so on. However, when I inspected the URI I get forwarded to, it is
https://gitlab.example.com//users/sign_in
(note the two slashes after the domain). This is not really a problem, but I would like to know why this is and how I can fix this - especially since it works just as fine when I remove one of the slashes from the address. (So https://gitlab.example.com/users/sign_in
is exactly the same).
In fact, I get forwarded twice:
GET https://gitlab.example.com
=>301 Moved Permanently
withLocation:https://gitlab.example.com/
GET https://gitlab.example.com/
=>302 Found
withLocation:https://gitlab.example.com//users/sign_in
This is my apache config file (`/etc/apache2/sites-enabled/gitlab.conf):
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
ProxyPassMatch ^(/[^/]+\.(html|png|ico|css|txt))$ !
ProxyPass /assets !
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://gitlab.example.com
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%(REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
Is this a problem with gitlab? How can I work around it?
Note: I am absolutely unsure which module is causing the forwarding behavior, if you need any other config files, just let me know.