The Edge and Reverse Proxy

Everything that sits between a visitor's browser and your app, and what your app needs to do to work behind it.

Updated Dec 1, 2026

The edge is the reverse proxy that serves every public HTTPS address of every deployment. It receives the visitor's connection, handles the TLS certificate, and forwards the request to your container on its primary port. You never configure it directly. You activate domains in the Domains tab of your deployment, and the edge picks up the change within a few seconds.

The addresses the edge serves

Once you click Activate domains, your deployment can have up to three addresses. They all lead to the same app, on the same port.

Address Example How you get it
Canonical URL https://abc123xyz0.apps.bot-hosting.cloud Assigned when you activate domains. It never changes, so it is safe to hard-code in bots, webhooks and integrations.
Pretty alias https://my-app.apps.bot-hosting.cloud Optional. You pick the name in the Domains tab, no DNS needed, and you can rename it at any time.
Custom domain https://bot.yourdomain.com Optional. A domain you own, verified through DNS. See Custom domains in depth.

For step by step instructions, see Link a Domain.

The path of a request

  1. The visitor's browser looks up your address. Platform addresses and verified custom domains all point to the edge.
  2. The edge accepts the connection, reads which site is requested, and checks that this site is not over its protection limits.
  3. The edge completes the HTTPS handshake with the certificate of that address.
  4. The edge forwards the request in plain HTTP to the node that runs your deployment, on its primary port.
  5. Your app answers, and the edge sends the response back to the visitor unchanged.

The edge learns about new, moved or removed addresses from the dashboard every few seconds, without restarting. A change to one site (a domain activated, an alias renamed, a deployment moved) never cuts the requests and WebSockets in progress on the other sites.

HTTPS and certificates

You never upload a certificate or a key. The edge takes care of it.

  • Addresses on apps.bot-hosting.cloud are covered by a platform certificate. They work over HTTPS as soon as you activate domains.
  • A custom domain gets its own certificate, issued automatically the first time someone opens it over HTTPS after you verified it. That first visit can take a few seconds longer. The certificate renews on its own.
  • Plain HTTP requests are redirected to HTTPS with a permanent 308 redirect. Your app only ever receives requests that arrived over HTTPS.

Your app must speak plain HTTP on its port. Do not enable HTTPS inside your app, and do not load your own certificate. The edge talks to your container in plain HTTP, so an app that expects a TLS handshake on its port cannot be reached and visitors get a 502 page.

Protocols

Between Protocols
Visitor and edge HTTP/1.1 and HTTP/2, over HTTPS. HTTP/3 (QUIC) is not offered, so browsers stay on HTTP/2.
Edge and your app HTTP/1.1, unencrypted

Because the hop to your app is HTTP/1.1, protocols that require HTTP/2 all the way to the server, such as gRPC, do not work through the edge. Expose them on a port directly instead, as explained in Ports and network.

WebSockets

WebSockets work through the edge with no setup. Use wss:// with the same address as your site, for example wss://my-app.apps.bot-hosting.cloud/socket. Socket.IO and similar libraries work the same way.

A WebSocket stays open as long as it carries traffic. A connection that stays completely silent for about an hour can be closed along the way, so send a heartbeat (a ping every 30 to 60 seconds is common). Most WebSocket libraries do this by default.

Headers your app receives

The edge passes the request to your app as the visitor sent it, and adds the standard proxy headers.

Header Value
Host The address the visitor opened, for example my-app.apps.bot-hosting.cloud or your custom domain
X-Forwarded-For The visitor's real IP address
X-Forwarded-Proto https
X-Forwarded-Host The address the visitor opened

The edge does not trust these headers when a visitor sends them. It replaces them with its own values, so X-Forwarded-For holds exactly one address, the one that connected to the edge.

Get the visitor's IP in your app

Without any setting, your app sees the edge as the client. Tell your framework that it runs behind one proxy.

Express
// Trust exactly one proxy hop (the edge)
app.set("trust proxy", 1);

app.get("/ip", (req, res) => res.send(req.ip)); // visitor's IP
FastAPI / uvicorn
uvicorn main:app --host 0.0.0.0 --port $SERVER_PORT --proxy-headers --forwarded-allow-ips="*"
Flask
from werkzeug.middleware.proxy_fix import ProxyFix

app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1)

This also fixes apps that build absolute links or force HTTPS. They read X-Forwarded-Proto, see https, and stop redirecting in a loop.

Your primary port is also reachable directly at the node's address, without going through the edge. Anyone who connects that way can send a fake X-Forwarded-For. Use the visitor IP for logs, rate limiting and analytics, never as the only proof of who someone is.

Do not allow only the edge's IP address in your app's firewall or allowlist. The edge can change addresses, and your app would then refuse every visitor. Trust the forwarded headers as shown above instead.

If your custom domain is proxied by Cloudflare (not supported, see Custom domains in depth), X-Forwarded-For holds a Cloudflare address and the visitor's IP is in the CF-Connecting-IP header that Cloudflare adds.

Limits and timeouts

Setting Value at the edge
Time to send the request headers 10 seconds
Idle keep-alive connection between two requests Closed after 60 seconds, browsers reconnect on their own
Silent WebSocket or long connection Can be closed after about an hour without any traffic
Request body size (uploads) No limit set by the edge. Your app or framework applies its own.
Time your app takes to answer No fixed limit for a request in progress. Long requests work, but a visitor's browser may give up first.

To protect every site on the platform, the edge also caps how many requests a single site can have in progress and start each second. A normal site never reaches these caps. When a site goes over them, for example during an attack, the extra requests get a 503 with a Retry-After header. If your app is legitimately that busy, contact support and describe your traffic.

Error pages and what they mean

When a request never gets an answer from your app, the edge shows its own page. You can recognize these pages by the "Hosted on Bot-Hosting" line at the bottom. Any other error page comes from your own app, and the edge passes it on unchanged.

What you see Meaning What to check
404, "Nothing is hosted at this address." No deployment is attached to this address on apps.bot-hosting.cloud. Domains are activated, the address matches the one in the Domains tab (lowercase), the alias was not renamed, the deployment was not deleted. A deleted deployment can be restored from Backups.
502, "Your app isn't answering." The address and the certificate work, but nothing answered on the app's port. See the checklist below.
504 with the same page The edge could not reach the node in time. The deployment's node may be down. Check the Location page and the status page.
503 with Retry-After The site is over the edge's protection limits. A traffic spike or an attack on this site. Wait, then contact support if it lasts.
A certificate or connection error on a custom domain The edge has no verified route for that domain, so it refuses to issue a certificate. The domain shows as verified in the Domains tab, and its DNS points to the edge. See Custom domains in depth.
The page never loads A timeout before the edge. See Connection timed out.

When you get a 502

Work through these in order. The Domains tab helps, since it shows App responding or No response on port next to the canonical URL.

  1. Is the app started? Open the console. A crash loop leaves nothing listening between two restarts.
  2. Does it listen on 0.0.0.0? An app bound to 127.0.0.1 or localhost only accepts connections from inside its own container, so the edge can never reach it.
  3. Does it use SERVER_PORT? Read the port from the environment instead of hard-coding 3000, 8080 or 5000.
  4. Does it speak plain HTTP? Turn off any HTTPS setting inside the app.
  5. Is it the primary port? The edge only forwards to the primary port. A web server on an additional port is only reachable at the node's address.

Node.js

const port = process.env.SERVER_PORT;
app.listen(port, "0.0.0.0", () => console.log(`Listening on ${port}`));

Python

uvicorn main:app --host 0.0.0.0 --port $SERVER_PORT

A checklist for any web app

  • Listen on 0.0.0.0 and on process.env.SERVER_PORT (or $SERVER_PORT).
  • Serve plain HTTP, let the edge handle HTTPS.
  • Trust one proxy hop so the visitor IP and https are detected.
  • Send a heartbeat on long-lived WebSockets.
  • Use the canonical URL in webhooks and integrations, since it never changes.
  • For a development server such as Vite, allow the host or, better, serve the production build. See Connection timed out.