> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-gdubroeucq-qov-2319.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-2319/3qsePqMwZO5o_pFX/images/cloudflare/1.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=0a4980bbc09caf910b49613ec28a6ec0" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/2.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=e8084ec4d1b8a4be44f9fb7f67a28d30" alt="Cloudflare CNAME configuration" width="3164" height="2070" data-path="images/cloudflare/2.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2319/3qsePqMwZO5o_pFX/images/cloudflare/3.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=3f41094e06d8677a33c71071881220d4" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/4.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=5101c4b7fcc8a22ede9ce610f0589b03" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/5.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=3bf82199f7fee671ad1d0019a0a4ae91" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/6.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=3acc788470f49db451e83833ffe47983" alt="Cloudflared tunnel setup" width="3380" height="1278" data-path="images/cloudflare/6.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2319/3qsePqMwZO5o_pFX/images/cloudflare/7.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=c4b060cc3ff349a6c6cd15d71fc65a93" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/8.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=1241f766ccb53b7f56984884faa1439b" alt="Domain verification" width="3164" height="2070" data-path="images/cloudflare/8.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2319/3qsePqMwZO5o_pFX/images/cloudflare/9.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=5b20c7c8dd37724543f3811effc7f15d" 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-2319/3qsePqMwZO5o_pFX/images/cloudflare/10.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=3b55a26282e581857b30dfca0e82f2bc" alt="Cloudflare WAF" width="3164" height="2070" data-path="images/cloudflare/10.png" />
</Frame>

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

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

<Frame>
  <img src="https://mintcdn.com/qovery-gdubroeucq-qov-2319/3qsePqMwZO5o_pFX/images/cloudflare/13.png?fit=max&auto=format&n=3qsePqMwZO5o_pFX&q=85&s=34dce394038f8744f01fb5cde302106c" 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.