सामग्री पर जाएँ

How to setup a CDN under Gitlab Organization

How to setup a CDN under Gitlab Organization

Hello my name is Luiz i'm a software engineer based in brazil, in this article i'll show you how to setup a static files CDN under Gitlab Organization using Gitlab Pages.

What is Gitlab Pages?

Gitlab Pages is a feature that allows you to host static websites directly from your Gitlab repositories. It’s similar to Github Pages, but with a few key differences:

  • Gitlab Pages supports HTTPS for custom domains with Let’s Encrypt, while Github Pages only supports HTTPS for github.io subdomains.
  • Gitlab Pages supports custom domains for private repositories, while Github Pages only supports custom domains for public repositories.

How to setup a CDN under Gitlab Organization

First of all you need to create a Gitlab Organization, if you don't have one yet, you can create one here.

After that you need to create a new project, you can do that here.

Now you need to create a new project with a setup and structure like this:

├── .gitlab-ci.yml
├── public/
   └── Here you put your static files like images, css, js, etc... to be served by the CDN
└── README.md

After that you need to create a new file called .gitlab-ci.yml and put this code inside:

image: alpine:latest

pages:
  stage: deploy
  script:
    - echo "Nothing to do..."
  artifacts:
    paths:
      - public
  only:
    - main

This file will tell Gitlab to deploy the public folder to Gitlab Pages.

Now you need to go to your project settings and enable Gitlab Pages, you can do that here. And make pages available to everyone.

How to use the CDN

As i told before this CDN is using the Gitlab Pages, so in order to access the project you need to go to https://YOUR_ORGANIZATION_NAME.gitlab.io/YOUR_PROJECT_NAME/.

How to use a custom domain

In order to use a custom domain you need to go to your project settings and add your custom domain, you can do that here.

After that you need to go to your domain provider and add a new CNAME record pointing to YOUR_ORGANIZATION_NAME.gitlab.io.

Profile picture
Luiz Fernando - सीनियर सॉफ़्टवेयर इंजीनियर

पढ़ने के लिए धन्यवाद!

आशा है यह लेख आपको पसंद आया। सवाल या प्रतिक्रिया हो तो सोशल मीडिया पर लिखें। आपका दिन शुभ हो!

Carousel imageCarousel imageCarousel imageCarousel imageCarousel image
आगे / अच्छी चीज़ बातचीत से शुरू होती है

बड़े विचार।
Little Luiz.

कोई उत्पाद जीवित करना है? कोई टीम मज़बूत करनी है? देखें हम साथ क्या बना सकते हैं।

अपना रास्ता चुनें
01Freelance / Products

मेरे पास एक प्रोजेक्ट है

फ़्रीलांस सहयोग, उत्पाद और तकनीकी चुनौतियाँ।

  • उत्पाद खोज से डिलीवरी तक
  • वेब, मोबाइल और बैकएंड इंजीनियरिंग
  • स्पष्ट स्कोप। सीधा सहयोग।
कुछ साथ बनाएँ
02Hiring / Teams

मैं टीम बना रहा हूँ

इंजीनियरिंग भूमिकाएँ और लंबे अवसर।

  • सीनियर फ़ुल-स्टैक इंजीनियरिंग
  • उत्पाद सोच और तकनीकी स्वामित्व
  • वितरित टीमों का अनुभव
अपनी टीम में शामिल करें
03Résumé / Versions

रिज़्यूमे देखें

सामान्य इंजीनियरिंग, हेल्थ-टेक, फ़िनटेक और अधिक के लिए तैयार संस्करण।

  • छह केंद्रित रूप
  • प्रिंट-तैयार PDF
  • हर भूमिका के लिए अपडेट
मेरा रिज़्यूमे पढ़ें
luizepauloxd@gmail.com

ईमेल पसंद है? सीधे लिखें, या यहाँ ड्राफ़्ट शुरू करें।

बताएँ आपके मन में क्या है।

© 2026 Luiz Fernando इरादे से बना। और थोड़ी जिज्ञासा से।ऊपर जाएँ