Gitlab and Apache as reverse proxy

  • Apache site with Letsencrypt certificate and access restrictions for some hosts/ips. Gitlab server's ip is 3.3.3.3

 

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName git.domain.com
    CustomLog ${APACHE_LOG_DIR}/git_access.log vhost_combined

    ProxyRequests off

    <Location />

        Require host my.domain.com your.domain.com
        Require ip 1.1.1.1 2.2.2.0/24

        ProxyPass "http://3.3.3.3/" retry=0
        ProxyPassReverse "http://3.3.3.3/"
    </Location>

    SSLCertificateFile /etc/letsencrypt/live/git.domain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/git.domain.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

 

 

sudo EXTERNAL_URL="http://git.domain.com" .....