sameersbn / sameersbn/docker-gitlab

Gitlab url is not correct if I use Nginx proxy with custom https port

Open
#3,009 1 comment 0 reactions 0 assignees View on GitHub

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 docker-compose file content (I have skipped some configs since they are not relevant):

version: '2'

services:
  gitlab:
    restart: unless-stopped
    image: sameersbn/gitlab:17.3.3
    container_name: gitlab
    ports:
    - "20080:80"
    - "20443:443"
    - "10022:22"
    environment:
    - GITLAB_HTTPS=true
    - SSL_SELF_SIGNED=false
    - NGINX_X_FORWARDED_PROTO=https

    - GITLAB_HOST=gitlab.example.com
    - GITLAB_PORT=10443
    - GITLAB_SSH_PORT=10022
    - GITLAB_RELATIVE_URL_ROOT=

And I use Nginx Proxy Manager to proxy gitlab, here is my config:

Proxy host name: gitlab.example.com
Scheme: http
Forward Hostname / IP: 192.168.1.105(my gitlab container's IP)
Forward Port: 20080
SSL Certificate: enabled
HTTP/2 Support: enabled

When I turn on the proxy, I can visit gitlab through https://gitlab.example.com:10443, but in gitlab's frontend page, it shows the incorrect url, for example, the Admin page button's url is https://gitlab.example.com, and every time I try to login into Gitlab, it redirect me to https://gitlab.example.com/users/sign_in, instead of https://gitlab.example.com:10443/users/sign_in, that's quite annoying.

Is there any problem with my config?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied docker-compose settings and the Nginx Proxy Manager proxy configuration, focusing on how the external HTTPS port 10443 is communicated to GitLab. Reproduce the redirect and inspect the generated frontend URLs; done means login and Admin links retain https://gitlab.example.com:10443.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.