AI Agent Management
Help Page proxy
Show your Help Page on your own domain, like your-domain.com/help, using rewrites.
Overview
Your Help Page lives at https://www.qwryai.com/{agentId}/help. A rewrite (a proxy) shows it at a path on your own site, such as https://your-domain.com/help. When a visitor opens the path on your domain, your server fetches the page from QwryAI and serves it. The address in the visitor's browser does not change.
Required routes
Proxy all four paths, or parts of the page will not load:
- /help and /help/*: the Help Page.
- /__qw/*: its static files (JavaScript, CSS, images).
- /api/chat/{agentId}/*: your agent's chat.
Next.js
- Open or create next.config.js at the root of your project.
- Add these rewrites. Place them before any catch-all route.
- Restart your Next.js server, then redeploy.
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{ source: "/help", destination: "https://www.qwryai.com/{agentId}/help" },
// Sub-pages of your Help Page.
{ source: "/help/:path*", destination: "https://www.qwryai.com/{agentId}/help/:path*" },
// Static files (JavaScript, CSS, images).
{ source: "/__qw/:path*", destination: "https://www.qwryai.com/__qw/:path*" },
// Your agent's chat.
{ source: "/api/chat/{agentId}/:path*", destination: "https://www.qwryai.com/api/chat/{agentId}/:path*" },
];
},
};
module.exports = nextConfig;Vercel
- Create vercel.json at the root of your project if it doesn't exist.
- Add these rewrites.
- Vercel applies them on your next deployment.
// vercel.json
{
"rewrites": [
{ "source": "/help", "destination": "https://www.qwryai.com/{agentId}/help" },
{ "source": "/help/:path*", "destination": "https://www.qwryai.com/{agentId}/help/:path*" },
{ "source": "/__qw/:path*", "destination": "https://www.qwryai.com/__qw/:path*" },
{ "source": "/api/chat/{agentId}/:path*", "destination": "https://www.qwryai.com/api/chat/{agentId}/:path*" }
]
}Netlify
- Create or open netlify.toml at the root of your project.
- Add these rules. status = 200 serves the page without changing the address.
- Netlify applies them on your next deploy.
# netlify.toml
# status = 200 serves the page without changing the address (a rewrite, not a redirect).
[[redirects]]
from = "/help"
to = "https://www.qwryai.com/{agentId}/help"
status = 200
force = true
[[redirects]]
from = "/help/*"
to = "https://www.qwryai.com/{agentId}/help/:splat"
status = 200
force = true
# Static files (JavaScript, CSS, images).
[[redirects]]
from = "/__qw/*"
to = "https://www.qwryai.com/__qw/:splat"
status = 200
force = true
# Your agent's chat.
[[redirects]]
from = "/api/chat/{agentId}/*"
to = "https://www.qwryai.com/api/chat/{agentId}/:splat"
status = 200
force = trueNode.js (Express)
- Install http-proxy-middleware: npm install http-proxy-middleware.
- Register these proxies before any body parser or catch-all route.
- Restart your server.
// server.js
const express = require("express");
const { createProxyMiddleware } = require("http-proxy-middleware");
const app = express();
const under = (base) => (path) => path === base || path.startsWith(`${base}/`);
// Register the proxies before body parsers.
app.use(createProxyMiddleware({
target: "https://www.qwryai.com",
changeOrigin: true,
pathFilter: under("/help"),
pathRewrite: (path) => path.replace(/^\/help(?=\/|\?|$)/, "/{agentId}/help"),
}));
app.use(createProxyMiddleware({ target: "https://www.qwryai.com", changeOrigin: true, pathFilter: under("/__qw") }));
// Your agent's chat, including its live connection.
app.use(createProxyMiddleware({ target: "https://www.qwryai.com", changeOrigin: true, ws: true, pathFilter: under("/api/chat/{agentId}") }));
app.listen(process.env.PORT || 3000);Check it works
- Open your-domain.com/help and confirm the Help Page loads with your logo and colors.
- Send several messages and wait for each full reply.
- Open a suggested message, a link card and Recent chats.
- Reload the page and confirm the conversation is still there.