When doing clone repository on my gitlab server, I get the wrong http url from the "Clone" button

I use gitlab to create a server on my Synology server. I run a docker on the Synology and install the gitlab on the docker. The docker name is “gitlab-docker”, and the port map is from docker 1080 to gitlab 80.

I put the Synology server in a LAN, and in order to access it from outer net, I use NAT service, in which I map the outer port 1801 to the Synology server ip and service port(docker port 1080). Besides, I use a DNS service to avoid public ip address changeing or missing, the domain name is kevin.synology.me. So I can access the gitlab server using “http://kevin.synology.me:1081”.

Then I create a project/repository using gitlab, and then using clone button on gitlab browser page but I get a wrong url. The url is docker’s host name “http://gitlab-docker//…”, while in fact the real url is “http://kevin.synology.me:1081//…” ( I manually input the url on git and it can work).

So I wonder how can I get the real url from Clone button, as showing below.

Then I do more tests:

  1. I changed the gitlab listion port as 1081 in gitlab.rb, as show below:

    and changed the docker map. then i restart the server. I can checkout and commit from git.
    However, the “Clone” button still give a wrong url, whick still missing the port and the wrong host name.
  2. when I create a new project/repository, the url is ok, as show below:

    but after created, when click “Clone” button, the url is wrong as described above.

So I don’t know what’s wrong with it, can anyone help me, thanks a lot!

Hello npulrj,

I have just started working with GitLab independently and am also facing this problem.

Could you find a solution so far?

Best regards,