Proxy GitLab with Go

JFrog Artifactory Documentation

JFrog Artifactory
Content Type
User Guide

Go Proxy Best Practice: Add Mirror Repository

We highly recommend that you create a remote repository pointing to the default go mirror ( and enter Artifactory as the Git provider. This way, Artifactory will be able to resolve cached public modules without querying the external registry, reducing the chance of rate limiting. For more information, see Set Up Go Proxy Mirror Repositories.

To create a remote repository that serves as a caching proxy for GitLab, follow these steps:

  1. Create a new remote repository and set Go as the Package Type.

  2. Set the Repository Key value, and enter the link to your GitLab environment in the URL field:

    • For GitLab Self-managed, enter your environment link

    • For GitLab SaaS, enter

  3. In the Go Settings tab, set the Git Provider as GitLab.

  4. In the Advanced tab, enter your GitLab username and password. To generate a GitLab password:

    1. Go to your GitLab account, click your avatar in the top right corner, and select Settings.

    2. Go to Access Tokens, and click Add new token.

    3. Enter a name and select permissions for your token: select the api and read_api permissions, and add other permissions according to your environment. When you are done, click Create personal access token.

    4. Copy the token you created, and paste it into the Password field in the JFrog platform.

  5. Click Save & Finish.

  6. Create a new virtual repository and under Repositories, select the remote repository you have created.

  7. Under Include/ Exclude Patterns, add the include pattern for GitLab, and click the + sign to add the pattern.

    • For GitLab Self-managed, enter your environment URL in this structure: **/<YOUR_URL>/**

    • For GitLab SaaS, enter **/**.

    You can use the virtual repository to resolve artifacts from your GitLab private registry.