I wanted to be able to host and share my own git repositories. Here’s how I set up my personal Gitlab instance for self-hosting behind my NGINX reverse proxy.
Setup Steps:
- Download the GitLab CE virtual machine .OVA file from bitnami
- Deploy the .OVA file in ESXi as a new virtual machine (note: the OVA might not upload on its own through the NGINX proxy interface. If necessary, use the direct IP Address of the ESXi server rather than any reverse proxied subdomain links for this step)
- Once the deployment finishes, configure the storage, CPU, and memory limits for the new virtual machine (I used 4 CPU cores, 6GB of RAM, and 250GB of thin provisioned storage)
- Power on the new VM, and login with the default bitnami/bitnami username and password. You’ll be prompted to change the password – choose something secure
- Add a record to your NGINX Reverse Proxy sites-available file pointing to the newly created gitlab instance’s local IP address (see config below)
- Modify the bitnami instance host name to match the subdomain and domain assigned in your reverse proxy setup (not sure this was actually necessary, but I did it, and it worked…)
- Rename the automatic configuration script to prevent overwriting your hostname settings
- Edit the external_url setting in /etc/gitlab/gitlab.rb to contain your FQDN (ex: https://gitlab.dupuis.xyz)
NGINX Configuration:
server{
listen 443;
server_name gitlab.dupuis.xyz;
ssl on;
ssl_certificate /etc/letsencrypt/live/dupuis.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrpyt/live/dupuis.xyz/privkey.pem;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass https://192.168.1.251;
}
}