You could start by taking a look at a question asked in the community in English Here
Based on this fact, we can talk about something called the Proxy Reverso || Reverse Proxy , which is used in web servers, such as apache or nginx to allow you to mask a port through a web port (80,443).
Personally I use "gogs" this unlike gitlab, it is free and unlimited, and it is also still in development, I had to configure a ReverseProxy to access it with a subdomain, then I share the site configuration in /etc/apache/sites-available/gogs
:
'
ServerName git.miservidor.com
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
SSLEngine ON
ServerName git.miservidor.com
SSLCertificateKeyFile /etc/apache2/ssl/privkey.pem
SSLCertificateFile /etc/apache2/ssl/cert.pem
SSLCertificateChainFile /etc/apache2/ssl/chain.pem
ProxyPreserveHost ON
ProxyRequests OFF
<Proxy *>
Order allow,deny
Allow From 190.0.0.1
</Proxy>
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
'
In this case, as you can see, in AllowFrom, you indicate the ip address from where the site will be accessible (If you are going to save your code, it is best to prevent it from crying).
And in the ProxyPass and ProxyPassReverse clause, our local host (127.0.0.1) is indicated and the port on which our git server runs (in my case it is gogs), with this, Apache is responsible for serving the requests avoiding exposing our git server directly.
I hope you serve