> ## Documentation Index
> Fetch the complete documentation index at: https://docs.preprod.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate a CDN resource with PyroCMS 2.x

PyroCMS 2.x can serve static assets through a Gcore CDN resource by setting a custom domain in the admin panel's Integration settings.

Create a [CDN resource](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource) before starting the integration. Configure its [custom domain](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) with a valid CNAME record and an active SSL certificate.

## PyroCMS 2.x

This procedure assumes a PyroCMS 2.x installation with the standard local static-asset layout and an **Integration** CDN field in the admin panel.

<Warning>
  Back up site files and the database before making changes.
</Warning>

<Steps>
  <Step title="Locate the custom domain">
    In the [Gcore Customer Portal](https://portal.gcore.com), find the custom domain on the [CDN resources](https://portal.gcore.com/cdn/resources/list) page.
  </Step>

  <Step title="Verify origin access">
    Identify a known static asset used by the site. Request the same path directly from the protocol and hostname configured as the CDN origin:

    ```text theme={null}
    https://origin.example.com/path/to/known-asset.css
    ```

    Continue only after the origin returns the expected file without a `403` or `404` response.
  </Step>

  <Step title="Open the Integration settings">
    Log in to the PyroCMS admin panel and navigate to **Settings** > **Integration**.
  </Step>

  <Step title="Set the CDN domain">
    Enter the custom domain as a hostname without the protocol or trailing slash: `cdn.site.com`.

    This setting changes URLs generated through the PyroCMS Asset library. Update hardcoded asset URLs in templates separately because the Integration setting doesn't rewrite them.
  </Step>

  <Step title="Apply the changes">
    Click **Save**.
  </Step>

  <Step title="Verify asset delivery">
    Open the browser's developer tools by pressing <kbd>F12</kbd>, select the **Network** tab, and refresh the page. Asset-library-generated URLs should load from the custom domain instead of the origin domain.
  </Step>
</Steps>
