Edge Routing · DNS & TLS Reference

CORS Behind a Reverse Proxy Explained

Configure Access-Control-Allow-Origin and OPTIONS preflight handling cleanly when your API sits behind an edge reverse proxy.

Record Type CNAME
Sub-Label @
Default TTL 300s Auto
MCP Tool set_proxy
DNS Record Anatomy — CORS Behind a Reverse Proxy HOST myapp.agentdomains.co Sub-label: @ TYPE CNAME TTL 300s Auto cache TARGET api-origin.up.railway.app Returned by 1.1.1.1 & 8.8.8.8 Authoritative zone: Cloudflare Edge DNS · Manage via Go CLI, REST API, or MCP tool

Exact DNS wire fields: HOST identifies the label, TYPE picks the record format, TTL sets cache duration, TARGET holds the answer.

1. Engineering Breakdown

Browsers check CORS against the public address bar URL (https://myapp.makes.fyi), not your origin host. Return HTTP 204 on OPTIONS requests and echo your allowed frontend origin.

Common Pitfalls

2. Interactive DNS Record Syntax Validator

Edit the record type, host label, or value below to validate syntax and build your CLI command.

Validate DNS syntax & generate AgentDomains CLI Query Live DoH Resolvers →
Validated CLI command

        

3. Exact CLI, curl & MCP JSON-RPC Payloads

Pick your preferred interface below and copy the working payload.

CLI command
agentdomains proxy api-demo api-origin.up.railway.app
REST API via curl
curl -i -X OPTIONS https://api-demo.makes.fyi/v1/items -H "Origin: https://app.example.com" -H "Access-Control-Request-Method: POST"
POST https://mcp.agentdomains.co (set_proxy)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_proxy",
    "arguments": {
      "label": "api-demo",
      "origin": "api-origin.up.railway.app"
    }
  }
}

Frequently asked questions

What is CORS & Reverse Proxies?

Configure Access-Control-Allow-Origin and OPTIONS preflight handling cleanly when your API sits behind an edge reverse proxy.

How do I automate CORS Behind a Reverse Proxy with AgentDomains?

Use the Go CLI snippet above, send a REST curl call, or invoke set_proxy on https://mcp.agentdomains.co.

Related DNS & SSL Guides

Edge Routing

Reverse Proxy vs URL Forwarding

Reverse proxy (set_proxy) serves your origin under your domain with HTTPS. URL forwarding (set_forward) sends a 301 or 302 redirect.

Edge Routing

301 vs 302 HTTP Redirects

302 is temporary and easy to change (our default). 301 is permanent and browsers cache it hard.

Edge Routing

Cloudflare Edge TLS & HTTPS

See how set_proxy handles TLS 1.3 at the edge and forwards traffic to your origin hostname.

Edge Routing

WebSockets & SSE Through Reverse Proxies

Keep long-lived wss:// WebSocket connections and AI token Server-Sent Events (SSE) streaming cleanly over HTTPS.

30 Days Free · No Card Required

Claim your agent domain now

Start with 10 free HTTPS domains under agentdomains.co or makes.fyi for 30 days. Upgrade to Pro for $10/year to keep up to 100 names with visitor stats.