Skip to main content

Connect a domain through your own Cloudflare

If the domain's zone is already in your own Cloudflare account and you want to keep it there, connect the domain with the Through my Cloudflare option. The Add domain wizard takes this way from your answers (see Step 1), and the AI assistant can do the same in a conversation. Qubix doesn't ask for the key to your Cloudflare account and doesn't change the zone's settings: you point the domain at the server and change a few settings in Cloudflare yourself. Visitors reach the server through your Cloudflare: the domain's record stays proxied (the orange cloud).

When to choose this option​

  • The domain's zone is in your Cloudflare account, and you don't want to give Qubix a key to it.
  • If you're ready to save a key to that account in Qubix, you can keep the zone in your account with Option A — Via Cloudflare instead: save the key as your personal key and pick it on the step Cloudflare account of the Add domain wizard. Then Qubix sets the zone up itself — and changes the settings of the whole zone: the encryption mode, Always Use HTTPS, the minimum TLS version, caching, Authenticated Origin Pulls and Browser Integrity Check. If other sites of this zone need different settings, choose Through my Cloudflare: with it, the encryption mode and Browser Integrity Check can be set for this domain alone — see the warning in Step 2.
  • If the domain should be served without proxying (the gray cloud), connect it with your own DNS.

All the ways to connect a domain are compared in Connect an existing domain.

Before you start​

  • Access to the domain's zone in your Cloudflare account. You will add a DNS record, change two SSL/TLS settings, turn off Browser Integrity Check and, sometimes, create a rule.
  • The right to set up domains in Qubix. Without it, the first step of the wizard has no Connect an existing one card.
  • The Via Cloudflare method among the Connection methods of your access template. Without it, Qubix refuses to connect the domain this way — ask the administrator.

No Cloudflare key is needed.

Step 1. Connect the domain in Qubix​

  1. Open Domains and click Add domain. On the first step, What to add, choose the Connect an existing one card and click Next. On the step Domain tasks turn on what the domain is for — it needs a site in Qubix, for example PWA or Postback intake — and click Next.
  2. On the step Domain name enter the domain (for example, mygames.click) and click Check. In the block Where the domain is now the row DNS reads Cloudflare · account not in Qubix: the zone is in a Cloudflare account Qubix has no key to. Click Next.
  3. On the step Traffic to the server choose Through Cloudflare and click Next.
  4. On the step DNS access choose Do it by hand following instructions and click Next. If you choose the key here instead, Qubix manages the zone, and this is Option A — Via Cloudflare with your account.
  5. Go on to the step Plan and confirmation. The row of the A record carries the mark done by hand: that part is yours. Click Confirm.
  6. On the step Waiting Qubix records the domain, and under the stage DNS records the domain's block shows the section In your Cloudflare account: the steps to take in your Cloudflare account, with the domain, the server's address and, when needed, the port already filled in. Qubix doesn't ask for the key of your Cloudflare account. Keep the step at hand: the steps are described in Step 2.

The second way is the AI assistant: ask it in plain words, for example, "Connect shop.mysite.com through my Cloudflare — keep the zone in my account." It lists the same steps in the conversation and checks the connection when you ask.

Whether this way suits a domain depends on the domain:

  • a domain that a Cloudflare zone of Qubix covers can't be connected this way — connect it with Option A — Via Cloudflare;
  • a domain already connected through your own Cloudflare whose first check hasn't passed yet can be connected this way once more — run the wizard for it again with the same answers, or ask the assistant to bring the steps back;
  • a domain connected through your own Cloudflare that has already passed a check, like any domain already live on this server, is refused — see Limits and refusals.

Step 2. Set up the zone in your Cloudflare account​

Do what the step Waiting lists, in the Cloudflare dashboard of the account that holds the domain's zone. The wizard fills in the domain, the server's address and the port; below they are mygames.click, 203.0.113.10 and 8443.

  1. DNS record. DNS → Records: an A record for mygames.click with the address 203.0.113.10, proxy status Proxied (orange cloud).
  2. Encryption mode. SSL/TLS → Overview: encryption mode Full — not Flexible and not Full (strict).
  3. Authenticated Origin Pulls. SSL/TLS → Origin Server → Authenticated Origin Pulls: turn on the switch in the Global section. You do not need to upload a certificate. This is how the server knows a request really came through Cloudflare, so it can trust the visitor's country and address.
  4. Port rule — only if the server's port is not 443. Rules → Origin Rules: create a rule for mygames.click that sets Destination Port to 8443. This server receives Cloudflare on port 8443; without the rule Cloudflare comes to port 443. When the server's port is 443, the list has no such step and no rule is needed.
  5. Browser Integrity Check. Security → Settings → Browser Integrity Check: turn the switch off. Otherwise Cloudflare refuses postbacks that affiliate networks send from their servers, and those conversions never reach this server. Cloudflare turns this check on by default, and it refuses requests signed by standard HTTP clients — Python-urllib, Java, libwww-perl: postbacks sent with such clients don't reach the server. This step comes right before the last line: it is step 5 when the list has the port rule, and step 4 otherwise.

The port is one for the whole server; the administrator sets it in the Cloudflare origin port section — see Panel domain.

The encryption mode and Browser Integrity Check are set for the whole zone

The mode on the SSL/TLS → Overview page and the switch on the Security → Settings page apply to every site of the zone. If other sites in this zone need a different mode or need Browser Integrity Check on, leave them as they are and set them only for this domain with a rule: Rules → Configuration Rules, a rule for the domain's hostname with the SSL setting Full and Browser Integrity Check off. Let the rule cover every path of the domain, not just the postback path: the check sends its requests to a path of its own, and with a rule for the postback path alone the domain keeps waiting for the check.

Visitors who open the domain over http

Also turn on SSL/TLS → Edge Certificates → Always Use HTTPS, or create a redirect to https for this domain only. Otherwise a visitor who opened the address over http may get an error page instead of the site. The check won't show this: it only sends requests over https.

Step 3. Check the connection​

The step Waiting runs the check by itself — once a minute while the wizard waits — and when you click Check now. Qubix sends a request to the domain through Cloudflare and checks that it reached this server. If it did, Qubix sends one more, signed like a request of a standard HTTP client, and checks that Cloudflare doesn't refuse it with code 1010: this is how the check sees Browser Integrity Check.

  • If the check passes, the stage DNS records is done and the domain is ready.
  • If not, a red line under the steps gives the reason — see What the check says. Fix what it names in Cloudflare and click Check now.

The last line of the list of steps sends you to the check. In the wizard it is not a button of the list: Qubix runs the check itself and when you click Check now. A stage that is not done within two days stops as did not work; after fixing the zone, click Retry next to it.

You don't have to keep the wizard open: you can close the window and Qubix goes on, and it also checks such domains by itself every 5 minutes. Each round of checks is limited in time, so when there are many such domains, some of them are checked in one of the following rounds. Until a check passes:

  • the domain sits in the Awaiting check group, and its card shows the same status in the Nameservers row;
  • once a check has named a reason, it is in the hint next to the status;
  • the domain isn't offered when you choose a domain for a campaign.

When a check passes, the domain moves to Working, and you can use it in campaigns.

Until the first check passes, you can get the steps back by running the wizard for the domain again with the same answers, or by asking the assistant to connect the domain through your Cloudflare once more.

What the check says​

The message of the check — the red line under the steps in the wizard — and the hint in the domain card fill in the domain, the server's address and the server's port; below they are mygames.click, 203.0.113.10 and 8443.

The check saysWhat to do
Ready: requests through your Cloudflare reach this server.Nothing: the domain is ready.
mygames.click does not resolve yet. Add the A record from step 1.The domain has no A record yet, or the record hasn't spread through DNS yet. Create the record from step 1, then check again.
The record points straight at this server with a grey cloud. Turn the proxy on (orange cloud).The record points at the server's address with proxying off, so requests bypass Cloudflare. Turn the orange cloud on for the record.
Requests through Cloudflare reach another server. Check that the A record has the address 203.0.113.10.The record leads to another address. Put the server's address from the message into the A record.
Cloudflare did not present its certificate. Turn on Authenticated Origin Pulls in the Global section (step 3).Authenticated Origin Pulls is off. Turn on the switch in the Global section.
Cloudflare presented a certificate you uploaded instead of its own. Use the Global switch, not a zone-level certificate (step 3).A certificate is uploaded for the zone in Authenticated Origin Pulls. Use the Global switch instead.
Encryption mode is Full (strict), and Cloudflare does not accept this server's certificate. Switch it to Full (step 2).Switch the encryption mode to Full.
Encryption mode is Flexible, so Cloudflare connects to the server without encryption. Switch it to Full (step 2).Switch the encryption mode to Full.
Cloudflare comes to port 443, but this server expects it on port 8443. Create the rule from step 4.Create the Origin Rules rule with the port from the message.
Cloudflare could not connect to this server. Go through the steps above, starting with the encryption mode.Cloudflare could not connect to the server at the address in the record. Check the address in the A record (step 1), the port rule if it is among the steps (step 4), and the encryption mode (step 2).
Port 8443 of this server cannot be reached from the internet. This is a server setting, not a Cloudflare one: open the port or contact the server administrator.The server's port for Cloudflare is closed from the outside. It is opened on the server, not in Cloudflare — see Panel domain.
Cloudflare does not have a certificate for mygames.click yet. Wait a little and check again.Cloudflare hasn't issued its certificate for the domain yet: wait and check again. If the domain is a subdomain two or more levels deep (for example, promo.shop.example.com), waiting won't help: Cloudflare's free certificate covers only the zone's own name and its first-level subdomains. Such a name needs a certificate ordered or uploaded in your Cloudflare — Advanced Certificate Manager or a custom certificate.
Cloudflare refuses requests sent from servers (code 1010): Browser Integrity Check is on. Turn it off in Security → Settings.Browser Integrity Check is on for the domain: Cloudflare refused the check's request signed like a standard HTTP client, and it will refuse postbacks sent with such clients — Python-urllib, Java, libwww-perl. Turn the switch off (step 5 when the list has the port rule, step 4 otherwise), or turn the check off for this domain alone with a rule — see the warning in Step 2.
The check did not reach this server: Cloudflare answered with code 1020. Go through the steps above once more.Cloudflare answered the check itself with the code shown — for example, a security rule or bot protection in your Cloudflare stopped the request. The check is a request from this server's address to a path starting with /.well-known/qubix-origin-check/; add an exception for it in the rules of your zone.
The server could not run the check. Try again later.The server could not run the check this time. Click Check now again later — or wait for the next automatic check.

After the domain is ready​

A domain connected through your own Cloudflare shows Via your Cloudflare in the Connection row of its card, with a hint that the zone is in your Cloudflare account and Qubix doesn't change it. The card has no Set up CF button.

The zone stays yours: its records and settings are changed in your Cloudflare account. If you've saved a key to this account in Qubix as your personal key, you can also view and edit the zone's records on the domain's DNS tab — see DNS records.

Qubix keeps checking the domain​

Every 5 minutes Qubix checks ready domains through Cloudflare again; each round is limited in time, so when there are many such domains, some of them are checked in one of the following rounds. The recheck looks for one thing — whether the domain's record still leads to this server: the record is gone, requests reach another server, or Cloudflare can't connect to the address in the record. Qubix counts such checks until one of them succeeds; a restart of Qubix starts the count over. When there are three of them and at least 10 minutes have passed since the first, the domain goes back to Awaiting check with the reason “Requests through Cloudflare reach another server. Check that the A record has the address …” and the server's current address. A single Cloudflare hiccup doesn't set the domain back.

  • The domain keeps serving the visitors who reach it; it just isn't offered for new campaigns until a check passes again.
  • One message about it goes to the Telegram chat assigned to the Cloudflare role — see Connections.
  • When a check passes again, the domain works as before. No message is sent about that.

Changes to other settings of the zone — for example, the encryption mode or Authenticated Origin Pulls — the recheck may not notice, and it doesn't look at Browser Integrity Check at all: the domain then stays Ready, and no message is sent. A ready domain has no check button, neither in the list nor in the card, so after changing the zone's settings, open the site yourself to make sure it works.

If the server moves or its port changes​

  • New server address. Change the address in the domain's A record in your Cloudflare: Qubix doesn't change the zones of domains connected this way, even if a key to the account is saved. When the main Cloudflare key is saved in Qubix settings → Connections → Cloudflare, the Update the address and re-apply button there updates the zones Qubix manages and lists the domains connected through your own Cloudflare separately, with the address to set.
  • New port for Cloudflare. Qubix doesn't change the rule in your Cloudflare. When the administrator chooses a new port in the Cloudflare origin port section (Panel domain), the section lists these domains. The server moves to the new port at once, and until their rule matches it, these domains may stop opening — so the owners of these domains should be warned before the change. Moving from 443 to another port — create the rule from step 4; from one port other than 443 to another — change the port in the rule; back to 443 — delete the rule.

Limits and refusals​

The connection method isn't changed from Qubix. For such a domain Qubix refuses Set up CF, connecting it through Cloudflare or with your own DNS, the method switch, the zone setup by the assistant under the main key or a company key, moving the panel onto this domain and buying this name. To those allowed to perform the action, all of them answer with the same message: “This domain's zone is in your own Cloudflare account, so the domain cannot be moved to our Cloudflare from here. Delete it and connect it again.” With your personal key — saved or pasted into the chat — the assistant works in your own Cloudflare account and, once you approve, sets up the zone; in proxy mode this changes the settings of the whole zone.

To move the domain to another option, delete it in its card and connect it again. Qubix won't delete a domain that an active campaign still uses — free it there first (see Domain settings). Until you connect it again, the domain isn't served.

When you connect, Qubix may refuse. In the wizard such a refusal stops the stage DNS records as did not work, and the reason is written under it:

  • “This domain is already live on this server. Only a new domain, or one whose connection has not finished, can be connected through your Cloudflare.” — the domain already works on this server with another option.
  • “This domain, its parent domain or one of its subdomains is already on our Cloudflare, so it cannot be connected through your Cloudflare. Connect it with “Through Cloudflare” instead.” — the zone of this name, of its parent domain or of one of its subdomains is in Qubix's Cloudflare account. Connect the domain with Option A — Via Cloudflare.
  • “Domain mygames.click is not available to you: you do not have rights to it. If you need it, ask an administrator.” — the domain is recorded in Qubix under another person, or its zone in Qubix's Cloudflare account isn't linked to your domains. Ask the administrator.

What's next​