Skip to main content

Domain Configuration

Fataplus uses a multi-tenant domain structure built on Cloudflare’s DNS and routing capabilities.

Domain Structure

The Fataplus platform uses the following domain architecture:
  • fata.plus - Main marketing site and CRM portal
  • bknd.fata.plus - Backend API and admin interface
  • [tenant].fata.plus - Multi-tenant client portals
All domains are managed through Cloudflare with nameservers:
  • kianchau.ns.cloudflare.com
  • blakely.ns.cloudflare.com

DNS Setup

Fataplus domains are configured in Cloudflare DNS.

Primary Domain (fata.plus)

The root domain serves the main application.
1

Verify domain ownership

Ensure fata.plus is added to your Cloudflare account:
  1. Go to Cloudflare Dashboard
  2. Verify fata.plus appears in your domains list
  3. Check status is Active
2

Configure nameservers

At your domain registrar, set nameservers to:
kianchau.ns.cloudflare.com
blakely.ns.cloudflare.com
3

Wait for propagation

DNS propagation typically takes 24-48 hours. Check status:
dig fata.plus NS

Backend Subdomain (bknd.fata.plus)

The backend API runs on a dedicated subdomain.
1

Navigate to DNS settings

  1. Go to Cloudflare Dashboard
  2. Select the fata.plus domain
  3. Go to DNS > Records
2

Add CNAME record

Create a new DNS record:
  • Type: CNAME
  • Name: bknd
  • Target: fataplus-bknd-backend.fenohery.workers.dev
  • Proxy status: Proxied (orange cloud)
  • TTL: Auto
Click Save
Type: CNAME
Name: bknd
Target: fataplus-bknd-backend.fenohery.workers.dev
Proxy: Enabled
TTL: Auto
Ensure the Proxy status is enabled (orange cloud) to benefit from Cloudflare’s CDN, DDoS protection, and SSL.

Alternative: Custom Domain via Workers

You can also configure custom domains directly through Cloudflare Workers:
1

Navigate to Workers & Pages

Go to Workers & Pages in Cloudflare Dashboard
2

Select your worker

Click on fataplus-bknd-backend
3

Add custom domain

  1. Go to Settings > Domains & Routes
  2. Click Add custom domain
  3. Enter: bknd.fata.plus
  4. Click Add domain
Cloudflare will automatically create the necessary DNS records.

Multi-Tenant Domain Routing

Fataplus supports tenant-specific subdomains: [tenant].fata.plus

Wildcard DNS Configuration

1

Add wildcard CNAME

In Cloudflare DNS for fata.plus:
  • Type: CNAME
  • Name: * (wildcard)
  • Target: fataplus-bknd-backend.fenohery.workers.dev
  • Proxy status: Proxied
  • TTL: Auto
2

Configure Worker routing

Update wrangler.json routes:
"routes": [
  {"pattern": "*.fata.plus/*", "zone_name": "fata.plus"},
  {"pattern": "bknd.fata.plus/*", "zone_name": "fata.plus"}
]
3

Deploy worker

wrangler deploy

Tenant Routing Logic

In your Worker code (src/index.ts), implement tenant detection:
export default {
  async fetch(request: Request, env: Env) {
    const url = new URL(request.url);
    const hostname = url.hostname;

    // Extract tenant from subdomain
    const parts = hostname.split('.');
    if (parts.length >= 3 && parts[parts.length - 2] === 'fata') {
      const tenant = parts[0];
      
      // Handle tenant-specific logic
      if (tenant !== 'bknd' && tenant !== 'www') {
        return handleTenantRequest(tenant, request, env);
      }
    }

    // Default routing
    return handleDefaultRequest(request, env);
  }
};

Example Tenant Domains

  • apollonlab.fata.plus - ApollonLab partner portal
  • demo.fata.plus - Demo client portal
  • agritech.fata.plus - AgriTech vertical portal

SSL/TLS Configuration

Cloudflare provides automatic SSL/TLS for all domains.

SSL Settings

1

Navigate to SSL/TLS settings

In Cloudflare Dashboard:
  1. Select fata.plus domain
  2. Go to SSL/TLS
2

Set SSL mode

Choose Full (strict) for maximum security:
  • Off: No encryption (not recommended)
  • Flexible: Encrypts client to Cloudflare only
  • Full: Encrypts end-to-end but doesn’t validate certificate
  • Full (strict): Encrypts end-to-end with certificate validation ✅
3

Enable additional features

Recommended settings:
  • ✅ Always Use HTTPS
  • ✅ Automatic HTTPS Rewrites
  • ✅ TLS 1.3
  • ✅ HTTP Strict Transport Security (HSTS)

Certificate Management

Cloudflare provides:
  • Universal SSL: Free, auto-renewing certificates
  • Wildcard SSL: Covers *.fata.plus automatically
  • Edge Certificates: Auto-provisioned within minutes
Cloudflare Workers have SSL enabled by default. No additional configuration needed for *.workers.dev domains.

Worker Routes Configuration

Define routing patterns in your Worker configuration.

Backend Worker Routes

In wrangler.json:
{
  "name": "fataplus-bknd-backend",
  "routes": [
    {
      "pattern": "bknd.fata.plus/*",
      "zone_name": "fata.plus"
    }
  ]
}

Multi-Route Configuration

For multiple routes:
{
  "routes": [
    {"pattern": "bknd.fata.plus/*", "zone_name": "fata.plus"},
    {"pattern": "api.fata.plus/*", "zone_name": "fata.plus"},
    {"pattern": "*.fata.plus/api/*", "zone_name": "fata.plus"}
  ]
}

Verification and Testing

DNS Verification

1

Check DNS resolution

# Check primary domain
nslookup fata.plus

# Check backend subdomain
nslookup bknd.fata.plus

# Check wildcard (example tenant)
nslookup demo.fata.plus
2

Test HTTP access

# Test backend API
curl -I https://bknd.fata.plus

# Test admin interface
curl -I https://bknd.fata.plus/admin

# Test tenant subdomain
curl -I https://demo.fata.plus
3

Verify SSL certificate

# Check certificate details
openssl s_client -connect bknd.fata.plus:443 -servername bknd.fata.plus

# Or use a browser and click the padlock icon

Online Tools

Use these tools for verification:

Troubleshooting

Domain not resolving (NXDOMAIN)

1

Check nameservers

Verify nameservers are set correctly at your registrar:
dig fata.plus NS
2

Verify DNS records

In Cloudflare Dashboard, ensure DNS records exist for:
  • @ (root domain)
  • bknd
  • * (wildcard)
3

Wait for propagation

DNS changes can take up to 48 hours. Check propagation:
dig bknd.fata.plus @8.8.8.8

SSL certificate errors

  1. Ensure Proxy status is enabled (orange cloud) in DNS
  2. Verify SSL/TLS mode is Full (strict)
  3. Check certificate status in SSL/TLS > Edge Certificates
  4. Wait a few minutes for certificate provisioning

Worker not responding on custom domain

  1. Verify route pattern in wrangler.json
  2. Ensure zone_name matches your domain exactly
  3. Redeploy worker: wrangler deploy
  4. Check DNS record points to correct Worker URL

Tenant routing not working

  1. Verify wildcard DNS record (*) exists
  2. Check Worker routing logic in code
  3. Test with explicit subdomain first
  4. Review Worker logs: wrangler tail

Production URLs

Current production endpoints:
# Main application
https://fata.plus

# Backend API
https://bknd.fata.plus
https://fataplus-bknd-backend.fenohery.workers.dev

# Admin interface
https://bknd.fata.plus/admin
https://fataplus-bknd-backend.fenohery.workers.dev/admin
The *.workers.dev URL will always work as a fallback, even if custom domain DNS has issues.

Best Practices

  1. Always use HTTPS - Redirect all HTTP traffic to HTTPS
  2. Enable proxy - Keep orange cloud enabled for security and performance
  3. Use Full (strict) SSL - Maximum security for encrypted connections
  4. Monitor DNS changes - Test after any DNS modifications
  5. Document tenant domains - Keep track of all active tenant subdomains
  6. Set up health checks - Monitor domain availability
  7. Enable HSTS - Prevent protocol downgrade attacks

Next Steps