LemonHost Blog

Back to Blogs
Author: LemonHost Devs Estimated Read: 5 min Category: Domains

How to Use a Domain with Your Server (Cloudflare)

Connect your domain through Cloudflare and route requests to your LemonHost server port correctly, with the extra checks that prevent the common 521 and timeout problems.

Part 1: Cloudflare setup

Add your domain to Cloudflare and replace your registrar nameservers with Cloudflare nameservers.

Why this setup matters

Cloudflare gives you DNS, SSL, and a layer of protection, but LemonHost still needs the request to reach the right origin port. If the DNS or origin rule is off by even one setting, the domain may load inconsistently or fail completely.

Create DNS record

Set SSL mode

Go to SSL/TLS overview and set mode to Flexible.

Part 2: Fix the random port issue

LemonHost servers often run on random ports. Cloudflare does not route arbitrary ports by default, so you must add an origin rule.

Create origin rule

Deploy the rule and wait one to two minutes before testing https://yourdomain.com.

Troubleshooting

Quick verification checklist