Wrong URL to projects, users and repos after configuration on VM

Hello everyone,

I have the following configuration:

  • domain: gitlab.example.com redirect to Windows Server 2019 (IP:
  • I have a domain with SSL to IIS along with redirecting configured in web.config
  • On the server I have a virtual machine with Ubuntu (IP:
  • I have several applications on a virtual machine so for GitLab-CE I have assigned the port: 8181
  • I have run GitLab on VM on port 6161 (

When everything is configured according to the following settings, gitlab works via WWW but when creating a group, repository or user panel instead of a domain I see the IP address of the switch to VM ( / …)

web.config in IIS:

<?xml version="1.0" encoding="UTF-8"?>
                <clear />
                <rule name="RewriteGitLabEncrypt" stopProcessing="true">
                    <match url="^\.well-known.*$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="None" />
                <rule name="RewriteGitLabRule" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />                    
                    <action type="Rewrite" url="{R:1}" />

000-default.conf (Apache site enable config):

<VirtualHost *:8181>
	ServerName gitlab.example.com
	AllowEncodedSlashes NoDecode

	RewriteEngine on
	RewriteCond %{REQUEST_URI} ^/uploads/.*
	RewriteRule .*{REQUEST_URI} [P,QSA,NE]

	ErrorLog ${APACHE_LOG_DIR}/gitlab_error.log
	CustomLog ${APACHE_LOG_DIR}/gitlab.log combined
	CustomLog ${APACHE_LOG_DIR}/gitlab_f.log common_forwarded


## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'https://gitlab.example.cm/'
nginx['enable'] = false
web_server['external_users'] = ['www-data']
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = ""

gitlab_rails['gitlab_host'] = 'gitlab.example.cm'
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'xxx'
gitlab_rails['gitlab_email_display_name'] = 'xxx'
gitlab_rails['gitlab_email_reply_to'] = 'xxx'
gitlab_rails['gitlab_email_subject_suffix'] = ''
gitlab_rails['gitlab_default_can_create_group'] = false

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "xxx"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "xxx"
gitlab_rails['smtp_password'] = "xxx"
gitlab_rails['smtp_domain'] = "xxx"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false

What am I doing wrong?
Of course, after each change, it performs the order reconfiguration, resets apache etc.