# Domains

Put your app on your own domain, such as `shop.example.com`, with HTTPS. Estiba connects it to Cloudflare for you, which issues and renews the certificate: you don't need a Cloudflare account or to set anything up there.

It also shields your app from attacks (DDoS) and serves images, styles and scripts from its cache near each visitor.

## Your visitors' real IP

Your app gets each visitor's IP address in the `X-Real-IP`, `X-Forwarded-For` and `True-Client-IP` headers, the ones most frameworks already read: one address, the visitor's, set by Estiba and never by the visitor, whichever server your app runs on. Useful for limiting logins, blocking abuse, logs or showing a visitor's country. Your agent tells your app to trust them, for example:

| Framework | Setting |
| --- | --- |
| Express | `app.set("trust proxy", true)`, then `req.ip` |
| Flask, Django, FastAPI | read the `X-Real-IP` header |
| Laravel | `$middleware->trustProxies(at: '*')`, then `$request->ip()` |

With Cloudflare on its own, [`True-Client-IP`](https://developers.cloudflare.com/network/true-client-ip-header/) comes only with its Enterprise plan, it removes `X-Real-IP`, and `X-Forwarded-For` reaches you starting with whatever the visitor wrote in it. On Estiba you get all three, with nothing to pay or set up.

## Add a domain

Ask your agent to add the domain to your app. It tells you the DNS record to create at the company where you bought the domain:

| Domain | Record |
| --- | --- |
| A subdomain, like `shop.example.com` | `CNAME` to `edge.estiba.cloud` |
| The domain itself, like `example.com` | `CNAME` to `edge.estiba.cloud` too, if your DNS allows it there (Cloudflare calls it CNAME flattening; others, `ALIAS` or `ANAME`) |

Once the record is in place, usually within minutes, the domain serves your app over HTTPS. The dashboard shows each domain as pending (waiting for its record) or active.

Some apps serve only HTTPS, with a certificate of their own, such as Crafty, Portainer or UniFi. Your agent marks their domain so Estiba reaches them over HTTPS (in the dashboard, the domain's HTTPS switch); visitors still get Estiba's certificate.

## Why is my domain still pending?

A pending domain says what it is waiting for: ask your agent why, or look at it in the dashboard. Usually it is one of these:

- **The record is missing or points elsewhere.** Check at the company where you bought the domain that the `CNAME` goes to `edge.estiba.cloud`, exactly as your agent gave it.
- **The domain itself can't take a `CNAME` at your DNS.** Use a subdomain such as `www.example.com`, or a DNS that offers CNAME flattening, `ALIAS` or `ANAME`.
- **`CAA` records leave out the certificate's issuers.** If your domain has them, they must allow Let's Encrypt, Google Trust Services and SSL.com.

A domain still pending after 24 hours is set aside, and says so: fix what it says, then ask your agent to save the app's domains again.

## More than one

- An app can have several domains, and different paths of one domain can go to different apps (`example.com/api` to one, `example.com` to another).
- Each subdomain is added on its own: `*.example.com` is not supported.

## What it is not for

Websites and apps, not mostly video, audio or large downloads: Cloudflare doesn't allow serving those through its network. Each request can send up to 100 MB.

## Ports

Bots, game servers such as [Minecraft](https://estiba.cloud/docs/minecraft-server-hosting) or [FiveM](https://estiba.cloud/docs/fivem-server-hosting) and anything that is not a website can listen on TCP or UDP ports instead. Your agent asks for one and gives you the address to connect to, at `ports.estiba.cloud`. Ports don't go through Cloudflare, and your app sees each client's own IP on the connection. A bot that connects out to [Discord](https://estiba.cloud/docs/discord-bot-hosting) or [Telegram](https://estiba.cloud/docs/telegram-bot-hosting) for its messages needs neither a domain nor a port.
