Could not visit any files in a repo

Hi, I have gitlab-ce 12.10.6 installed on my Synology nas via docker. When I visit my repo, I could not open any single file in that repo, say the, it would redirect me to my website home page. For example, when I visit, it redirects me to, where 5000 is the default port for synology nas admin webpage.

Here is the log: gitlab.log, unicorn_stdeer.log.

How could I make it work again?

My port direct: 40080 <-> 80
So the correct url for my repo is, but when I click a file in the repo, the url is without port, that is why I get the error. I don’t know why.

I try with a newly deploy instance with:

sudo docker run --detach \
  --hostname \
  --env GITLAB_OMNIBUS_CONFIG="external_url ''; gitlab_rails['lfs_enabled'] = true;" \
  --publish 40443:443 --publish 40080:80 --publish 40022:22 \
  --name gitlab \
  --restart always \

And then I visit, create my first repo with a The is, but the correct url should be Other url not related to files in the repo is correct, say So what is going on?

I carefully read this section, it’s said that:

The port specified in this URL must match the port published to the host by Docker.

Did it mean I have to use --publish 40080:40080 --env GITLAB_OMNIBUS_CONFIG="external_url ''; not --publish 40080:80 --env GITLAB_OMNIBUS_CONFIG="external_url ''? I have to use the same port in both container and host for webpage (gitlab rails?), default is 80, but I the 80 port in host is occupied, I have to specify the a new same port in both container and host, say 40080:40080, and add it to external_url?


The base URL needs to know where it can be reached. external_url + /root/helloworld/-/blob/master/ is what you get for the link.

The port mapping is imho fine with

host: 40080
container: 80

From a network perspective, the client opening a website will always come via 192.168.x.x and not use any other local routing.


1 Like