Need for external_ssh_url

Description

When using a custom SSH port behind a proxy setup or by forwarding ports to gitlab server the SSH url that gitlab provides to clone the repo through SSH relfects gitlab's ssh_port, but may be different from the port exposed to the users (when using a custom port).

When accessing the gitlab's web interphace with http (s) or to clone the external_url setting is used to appropriately show the correct URL. We need a similar setting to show the appropriate SSH URL for custom SSH port setups.

I am not shure how often is gitlab installed with with custom/non default ssh ports, but my gues would be 'not very often' since this issue has not been looked into yet. Unless I'm wrong.

The current behaviour may be considered a bug by some.

Say I have my main server with the port 2222 forwarded to port 25622 on gitlab's server. So, gitlab's ssh is running on port 25622. Then on a project's page with SSH keys setup the SSH url to clone the repo shows as ssh://git@my.domain:25622/some-group/some-project.git, however, to actually reach the gitlab server using SSH, I would have to use the following url ssh://git@my.domain:2222/some-group/some-project.git.

Proposal

Add a setting such as external_ssh_url to address instances where a custom SSH port is used and gitlab is reached behind a proxy or by forwarded ports to gitlab's server.

Links / references

😕

Edited Jun 17, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading