diff --git a/.env.example b/.env.example index b55a826..1ef3d70 100644 --- a/.env.example +++ b/.env.example @@ -2,3 +2,6 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mtc_reverse_proxy?sc PORT=4000 FRONTEND_ORIGINS="http://localhost:5173,http://127.0.0.1:5173" REVERSE_PROXY_TIMEOUT_MS=15000 + +# key for the Hestia-Nginx-Reverse-Proxy agents (same on every server) +AGENT_API_KEY= diff --git a/src/routes.js b/src/routes.js index b63a5ec..c516219 100644 --- a/src/routes.js +++ b/src/routes.js @@ -421,6 +421,7 @@ router.post("/services/:id/reverse-proxy", async (req, res, next) => { method, headers: { "content-type": "application/json", + ...(gateway && process.env.AGENT_API_KEY ? { "x-api-key": process.env.AGENT_API_KEY } : {}), }, body: method === "GET" ? undefined : JSON.stringify(body || {}), signal: controller.signal,