Reverse Proxy Configuration Templates
Use these templates to proxy Screeb's endpoints through your own domain.
Replace analytics.acme.com with your actual proxy hostname.
Target endpointsโ
| Route prefix | Proxy target |
|---|---|
/sdk/ | https://t.screeb.app/ |
/rpc/ | https://rpc.screeb.app/rpc/ |
/static/ | https://static.screeb.app/ |
/report/ | https://r.screeb.app/rpc/ |
/hosted-page/ | https://survey.screeb.app/ |
/centipede/ | wss://centipede.screeb.app/ (WS) |
nginxโ
server {
listen 443 ssl;
server_name analytics.acme.com;
# SSL configuration โ use certbot or your certificate provider
# Screeb SDK loader
location /sdk/ {
proxy_pass https://t.screeb.app/;
proxy_set_header Host t.screeb.app;
proxy_ssl_server_name on;
}
# Screeb RPC (REST API)
location /rpc/ {
proxy_pass https://rpc.screeb.app/rpc/;
proxy_set_header Host rpc.screeb.app;
proxy_ssl_server_name on;
}
# Screeb static assets
location /static/ {
proxy_pass https://static.screeb.app/;
proxy_set_header Host static.screeb.app;
proxy_ssl_server_name on;
}
# Screeb report
location /report/ {
proxy_pass https://r.screeb.app/rpc/;
proxy_set_header Host r.screeb.app;
proxy_ssl_server_name on;
}
# Screeb hosted survey page
location /hosted-page/ {
proxy_pass https://survey.screeb.app/;
proxy_set_header Host survey.screeb.app;
proxy_ssl_server_name on;
}
# Screeb WebSocket (real-time targeting)
location /centipede/ {
proxy_pass https://centipede.screeb.app/;
proxy_set_header Host centipede.screeb.app;
proxy_ssl_server_name on;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Cloudflare Workersโ
Deploy this as a Cloudflare Worker on your analytics.acme.com zone:
const ROUTES = {
"/sdk/": "https://t.screeb.app",
"/rpc/": "https://rpc.screeb.app/rpc/",
"/static/": "https://static.screeb.app",
"/report/": "https://r.screeb.app/rpc/",
"/hosted-page/": "https://survey.screeb.app",
"/centipede/": "https://centipede.screeb.app",
};
export default {
async fetch(request) {
const url = new URL(request.url);
for (const [prefix, target] of Object.entries(ROUTES)) {
if (url.pathname.startsWith(prefix)) {
const targetUrl = new URL(
url.pathname.slice(prefix.length) + url.search,
target,
);
const proxied = new Request(targetUrl, request);
proxied.headers.set("host", new URL(target).hostname);
return fetch(proxied);
}
}
return new Response("Not Found", { status: 404 });
},
};
Vercelโ
Add to your project's vercel.json. Vercel rewrites forward traffic server-side:
{
"rewrites": [
{ "source": "/screeb/sdk/:path*", "destination": "https://t.screeb.app/:path*" },
{ "source": "/screeb/rpc/:path*", "destination": "https://rpc.screeb.app/rpc/:path*" },
{ "source": "/screeb/static/:path*", "destination": "https://static.screeb.app/:path*" },
{ "source": "/screeb/report/:path*", "destination": "https://r.screeb.app/rpc/:path*" },
{ "source": "/screeb/hosted-page/:path*", "destination": "https://survey.screeb.app/:path*" }
]
}
note
Vercel rewrites do not support WebSocket proxying natively. For real-time targeting (centipede), use a dedicated WebSocket-capable proxy for that endpoint.
Next stepsโ
Once your proxy is running, follow the Custom Collector URL guide to configure the SDK and the Screeb Admin allowed domains list.