> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-docs-rde-install-script.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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/1.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=2a789c9b0a50bab734f3ec79aed6b583" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/2.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=737c3446a5a1414b802aa90ac67ff394" alt="Cloudflare CNAME configuration" width="3164" height="2070" data-path="images/cloudflare/2.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/3.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=069931ba205898bee58e79eeff4aa90a" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/4.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=238d99bc09263f80ecc05e19c5a4690e" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/5.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=ac35c841315eb59561f3580830d73620" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/6.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=6512d72f72dc19e341330b6188b2ce54" alt="Cloudflared tunnel setup" width="3380" height="1278" data-path="images/cloudflare/6.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/7.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=247a3d3c4ce8ccc21075817a20a4cc68" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/8.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=4c59068b34a83384aa39e13096e300bf" alt="Domain verification" width="3164" height="2070" data-path="images/cloudflare/8.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/9.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=57b9a90e3030883abed5dc6bb2a5a58a" 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-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/10.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=3d22b86154fbacfdd012728ccfce1732" alt="Cloudflare WAF" width="3164" height="2070" data-path="images/cloudflare/10.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/11.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=4dea16153b475382006c2376a73031f4" alt="Firewall rules" width="1083" height="301" data-path="images/cloudflare/11.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/12.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=e8e6f2eeb4230917604488a65a11458f" alt="Page rules" width="3164" height="2070" data-path="images/cloudflare/12.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-docs-rde-install-script/KTc5AUr7JkfB8ftS/images/cloudflare/13.png?fit=max&auto=format&n=KTc5AUr7JkfB8ftS&q=85&s=9e0fff0f28c1fffca945fadd9c82877b" 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>
