no icons shown if using relative path and behind a proxy
Summary
Gitlab shows no Icons (arrows, star, lock e. g.) if behind a proxy and a relative path is configures.
I found (and tried) solutions for configuring gitlab behind a proxy and gitlab using relative path, but I found no solution for this combination.
Steps to reproduce
- we used the latest gitlab-ce docker container (
gitlab/gitlab-ce:8.12.1-ce.0) - we configured gitlab to be run behind an apache2 server with a relative path configured:
changes in /etc/gitlab/gitlab.rb
external_url "https://maven02.our.domain/gitlab"
gitlab_rails['gitlab_ssh_host'] = 'maven02.our.domain'
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
Apache2 configuration (excerpt; proxying other applications works fine, e. g. jenkins):
# Proxying für gitlab
ProxyPass /gitlab http://127.0.0.1:20080/gitlab nocanon
ProxyPassReverse /gitlab http://127.0.0.1:20080/gitlab
ProxyPassReverse /gitlab https://maven02.our.domain/gitlab
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
docker run command:
docker run -d --hostname maven02.our.domain -p 20080:80 -p 20022:22 --name gitlab -v gitlab-config:/etc/gitlab -v gitlab-log:/var/log/gitlab -v gitlab-data:/var/opt/gitlab --env 'GITLAB_RELATIVE_URL_ROOT=/gitlab' gitlab/gitlab-ce:latest
Expected behavior
icons showing
Actual behavior
Icons not showing. Except this everything works fine.
Relevant logs and/or screenshots
Output of checks
Results of GitLab application Check
# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 3.6.0 ? ... OK (3.6.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... no
User id for git: 998. Groupd id for git: 998
Try fixing it:
sudo chown -R git:git /var/opt/gitlab/git-data/repositories
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
4/1 ... ok
2/2 ... ok
5/3 ... ok
2/4 ... ok
2/5 ... ok
4/6 ... repository is empty
2/7 ... ok
5/8 ... ok
5/9 ... ok
5/11 ... ok
2/12 ... ok
6/13 ... 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 users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain
DN: stuff deleted ...
...
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? ... no
Try fixing it:
sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads
sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} \;
sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} \;
For more information see:
doc/install/installation.md in section "GitLab"
Please fix the error above and rerun the checks.
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: ...
4/1 ... yes
2/2 ... yes
5/3 ... yes
2/4 ... yes
2/5 ... yes
4/6 ... yes
2/7 ... yes
5/8 ... yes
5/9 ... yes
5/11 ... yes
2/12 ... yes
6/13 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 3
Checking GitLab ... Finished
Results of GitLab environment info
# gitlab-rake gitlab:env:info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:1.13.1
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.12.1
Revision: ca3c6a4
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://maven02.our.domain/gitlab
HTTP Clone URL: https://maven02.our.domain/gitlab/some-group/some-project.git
SSH Clone URL: ssh://git@maven02.our.domain:20022/some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 3.6.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Possible fixes
Maybe it's a proxy missconfiguration, but I have no further idea.