sameersbn / sameersbn/docker-gitlab
some things dont work when running behind a reverse proxy
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 8.1k
- Forks
- 2.1k
- Avg merge
- 17h 47m
- Merged PRs (30d)
- 7
Description
Here is my current setup.
- Nginx listens on port 80 (runs inside docker) and serves other things. Publically visible on port 80 of the server
- Gitlab (this setup) run on a separate docker on port public port 10080
- The nginx serving on port 80 has a redirect from its /git location to an internal ip (172.17.0.N:10080 (gitlab docker)).
The results.
Most things work fine, with a few exceptions.
See here for example
http://vlcore.vectorlinux.com/git/m0e.lnx/flashplugin/builds
Clicking on either of the builds listed there goes nowhere. I can see that it's trying to go to gitlab/git/<rest_of_the_url> whic is wrong.
Is there a way to fix that?
The links work fine if the site is visited on port 10080
Here are the relevant snippets of my config files on the nginx serving on port 80
nginx.conf
[....]
location /git$ {
return 301 http://vlcore.vectorlinux.com/git/;
}
location /git/ {
proxy_pass http://gitlab;
}
[....]
And the additional gitlab.conf used by the main nginx.conf
upstream gitlab {
server 172.17.0.1:10080 fail_timeout=0;
}
server {
listen 80;
server_name git.vlcore.vectorlinux.com;
server_tokens off;
root /dev/null;
client_max_body_size 20m;
# individual logging
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location / {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_set_header Connection "";
proxy_pass http://gitlab/git/;
# ^^ /git appended because GITLAB_RELATIVE_ROOT is set to '/git/'
}
}
Any help on how to fix this is greatly appreciated.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the nginx.conf and gitlab.conf snippets, then reproduce the build-link failure through /git and compare it with direct access on port 10080. Inspect how the /git proxy path and GITLAB_RELATIVE_ROOT setting affect generated URLs. Done means build links retain the /git prefix and work through the reverse proxy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, gitlab, nginx
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100