> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-gdubroeucq-qov-2345.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Cloudflare and Custom Domain on Qovery

> Configure Cloudflare as a domain provider for your Qovery applications

This tutorial guides you through configuring Cloudflare as a domain provider for applications deployed on Qovery. The process involves adding a custom domain and establishing proper DNS and SSL/TLS settings.

## Prerequisites

* Active Qovery application
* Domain ownership on Cloudflare or registrar
* Access to Cloudflare DNS settings

## Step 1: Add a Custom Domain

1. Access your application settings in Qovery Console
2. Navigate to the **Domains** section
3. Enter your Cloudflare-managed domain
4. **Critical**: Enable the **"Domain behind a CDN"** toggle

<Info>
  Enabling "Domain behind a CDN" automatically disables certificate generation since Cloudflare handles SSL/TLS management.
</Info>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/1.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=3f61cff4cee89d00c81de5d6b65250e2" alt="Add custom domain" width="2212" height="848" data-path="images/cloudflare/1.png" />
</Frame>

## Step 2: Configure Cloudflare DNS

### Add CNAME Entry

1. Go to Cloudflare DNS settings
2. Add a CNAME entry using values provided by the Qovery Console
3. The proxy mode can remain enabled

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/2.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=6ba6a708cb261e1d386545a45aea99b8" alt="Cloudflare CNAME configuration" width="3164" height="2070" data-path="images/cloudflare/2.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/3.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=6ff6328303da8bd0f659338e37e23f4d" alt="CNAME record details" width="3164" height="2070" data-path="images/cloudflare/3.png" />
</Frame>

## Step 3: Configure SSL/TLS Settings

The last step to configure the domain Cloudflare side properly is to use the **Full** TLS encryption for proper custom domain functionality.

1. Navigate to **SSL/TLS** settings in Cloudflare
2. Select **Full** encryption mode

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/4.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=52054d87b763fb78ca7c34a4fa76aa11" alt="SSL/TLS Full encryption" width="2003" height="986" data-path="images/cloudflare/4.png" />
</Frame>

<Warning>
  Using "Flexible" encryption mode will not work properly with Qovery. Always use "Full" or "Full (strict)" mode.
</Warning>

## Step 4: Access Restriction Options

You have two options for restricting access to your application:

### Option 1: IP Whitelisting

Add Cloudflare IP ranges to Qovery's advanced settings to allow only Cloudflare traffic.

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/5.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=cb506974c077185b2fd1aa3f89a76c74" alt="IP whitelisting configuration" width="2358" height="1354" data-path="images/cloudflare/5.png" />
</Frame>

### Option 2: Cloudflared Tunnel

Cloudflared establishes outbound tunnels between resources and Cloudflare's network, enabling tunnel-based access without public exposure.

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/6.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=1f6432cfc7f794f8b6044410665c8ca7" alt="Cloudflared tunnel setup" width="3380" height="1278" data-path="images/cloudflare/6.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/7.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=86d7438a192166ca68aa2a593d96b059" alt="Tunnel configuration" width="3068" height="2168" data-path="images/cloudflare/7.png" />
</Frame>

## Verification

Once configured, your application should be accessible via your custom domain through Cloudflare's network.

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/8.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=df9d8fbeb042dd079195efd6e5f46ed4" alt="Domain verification" width="3164" height="2070" data-path="images/cloudflare/8.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/9.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=19370be8e92f66a261a5e1947ca1c575" alt="SSL certificate verification" width="3164" height="2070" data-path="images/cloudflare/9.png" />
</Frame>

***

## Additional Configuration

### Advanced Cloudflare Features

You can leverage Cloudflare's additional features:

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/10.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=b3825fe1a45bf4b7072511f412c281ec" alt="Cloudflare WAF" width="3164" height="2070" data-path="images/cloudflare/10.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/11.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=3eca308274215c34d96748483a2682ec" alt="Firewall rules" width="1083" height="301" data-path="images/cloudflare/11.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/12.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=71a2e3acd35d8c4a7555e54274feed81" alt="Page rules" width="3164" height="2070" data-path="images/cloudflare/12.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2345/kkEtGxkq4t-b17zM/images/cloudflare/13.png?fit=max&auto=format&n=kkEtGxkq4t-b17zM&q=85&s=ed5203ebe67b532b6b952e15c22fbc9d" alt="Analytics dashboard" width="3164" height="2070" data-path="images/cloudflare/13.png" />
</Frame>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Domain not resolving">
    * Verify CNAME record is correct
    * Check DNS propagation (can take up to 48 hours)
    * Ensure proxy mode is enabled in Cloudflare
  </Accordion>

  <Accordion title="SSL/TLS errors">
    * Confirm "Full" encryption mode is selected
    * Wait for SSL certificate provisioning (5-10 minutes)
    * Check that "Domain behind a CDN" toggle is enabled in Qovery
  </Accordion>

  <Accordion title="502 Bad Gateway errors">
    * Verify application is running in Qovery
    * Check that the CNAME points to the correct Qovery domain
    * Ensure Cloudflare IP ranges are whitelisted if using IP restriction
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Custom Domains" icon="globe" href="/configuration/application">
    Learn about custom domain configuration
  </Card>

  <Card title="SSL/TLS Certificates" icon="lock" href="/getting-started/security-and-compliance/overview">
    Understand SSL/TLS certificate management
  </Card>

  <Card title="Advanced Settings" icon="sliders" href="/configuration/service-advanced-settings">
    Configure advanced service settings
  </Card>

  <Card title="Networking" icon="network-wired" href="/configuration/integrations/api-gateway-nginx">
    Learn about networking and ingress
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.