Project Content Proxy and Embedding
Project Proxy Settings configure which external hosts the platform can fetch through a named proxy and which sites may embed its response. Use this for a controlled external page/content integration. The current implementation performs a server-side GET and returns rewritten content; it does not provide a general authenticated API connector, preserve every upstream response header or reproduce a complete browser session.
Configure the project proxy
- Open Proxy Settings for the intended project at
/p/{team}/{project}/proxy-settingson the dashboard host. Availability depends on the project's Proxy Settings feature and dashboard navigation. - Create a named setting. Creation generates its route slug from the supplied slug or name plus a random four-character suffix. Retain the returned slug; do not derive the runtime URL from the name alone. Detail routes use the slug, not the database ID.
- Open Settings → Allowed URLs. Add the exact external hostnames that may be fetched. The editor normalizes a URL such as
https://content.example.com/pathtocontent.example.com; this is a host list, not a list of permitted individual paths. - Under Allowed Embed URLs, enter the intended embedding site's origin where needed. The editor retains scheme, port and non-root path while normalizing the hostname. Enter an origin such as
https://portal.example.com, without a page path, even though the editor preserves non-root paths; do not assume a stored path supplies a reliable per-page embedding restriction. These values feed the response's frame-ancestor policy; they do not decide which upstream hosts may be fetched. - Explicitly Save, reload and verify both lists. Autosave is disabled. The initial create contract supplies a name/slug, not complete allowlist configuration; configure and verify the arrays before attempting runtime requests.
- Test a controlled public page first, then the actual embedding client, its resources and intended access boundary. A successfully saved setting is not a successful fetch or browser embed.
The backend appends the CSP 'self' source to embed ancestors. That means the response's own origin; it is not an attendee audience or a grant to every portal. Keep the external source-host list separate from the embedding-site list. A wildcard-looking host entry does not create wildcard matching in the runtime host check. The editor lowercases saved hostnames, but the runtime compares the parsed upstream host without explicitly lowercasing it. Use lowercase hostnames in the upstream URL and verify the actual request; do not assume identical normalization for manually submitted configuration or mixed-case URLs.
Permissions and public exposure
The resource policy catalog maps viewing to view_project_proxy_settings and management to manage_project_proxy_settings. Current navigation instead names view_proxy_settings. Treat this mismatch as an implementation caveat when diagnosing a missing menu; do not grant an unrelated permission or assume either label proves endpoint enforcement.
The reviewed dashboard controller does not explicitly call a resource policy or register resource authorization. Verify route middleware, team/project binding, allowed and excluded operators for listing, viewing, saving and deleting. Detail/update binding and the menu require their own deployed acceptance; a source-scoped list query is not proof that every operation rejects another project's setting.
The runtime GET route explicitly removes Sanctum authentication and the project-scope middleware used by nearby API routes. Its controller resolves team/project slugs and that project's proxy slug itself. It checks the requested URL's parsed host against Allowed URLs and returns 403 with Domain not allowed when absent. This route is intended to serve external content without requiring the caller's attendee session; the proxy slug is not a secret or a private-content authorization mechanism.
Use content appropriate for that exposure. The current fetch does not forward the caller's cookies, authorization headers or configured provider credentials. URLs, query parameters and response bodies can pass through logs, browser history or shared cache. Keep private tokens and personal data out of proxy URLs, lists and upstream content; the dashboard update path logs its validated payload. The inspected implementation does not establish redirect-target revalidation or a complete network-destination security boundary. Have the platform owner assess destination/redirect behavior before enabling an unfamiliar source.
Build the runtime URL
The route is GET /api/v1/projects/{teamSlug}/{projectSlug}/proxy/{proxySettingSlug} on the configured API host, with the upstream URL in the url query parameter. Encode that value as one query parameter rather than concatenating its query string into the outer request.
const apiOrigin = 'https://api.example.com'; // Replace with the deployment's API origin.
const teamSlug = 'example-team';
const projectSlug = 'example-project';
const proxySlug = 'partner-content-a1b2'; // Use the actual saved slug.
const upstreamUrl = 'https://content.example.com/guide?section=start&lang=en';
const proxyUrl = new URL(
`/api/v1/projects/${encodeURIComponent(teamSlug)}/${encodeURIComponent(projectSlug)}/proxy/${encodeURIComponent(proxySlug)}`,
apiOrigin,
);
proxyUrl.searchParams.set('url', upstreamUrl);
proxyUrl.href is the constructed request URL, not evidence the destination is available. Use the deployment's supported embedding component and inspect its browser result. The example performs no fetch or iframe insertion. Before using a real URL, save content.example.com in Allowed URLs and configure the intended embed origin.
Response and compatibility limits
The current controller fetches with a server-side GET and returns the body as text/html. It does not transparently relay the upstream status, MIME type, response headers or browser authentication. An upstream error body can therefore appear without an equivalent upstream HTTP status at the proxy boundary. Inspect the actual upstream and rendered response before diagnosing content as healthy.
Rewriting finds relative double-quoted src attributes. Root-relative sources are rebuilt with HTTPS and the upstream hostname; other relative sources are based on the requested URL's directory, then routed through the same proxy. Absolute HTTP/HTTPS sources remain absolute. This is not complete HTML/CSS rewriting: links, stylesheets, CSS URLs, srcset, single-quoted attributes, forms and JavaScript-generated requests need their own compatibility checks. Rewritten child hosts must still pass the runtime allowlist. Resources served through this controller also receive its HTML content type; do not assume script, style or image compatibility from a successful parent-page request.
The response sets CSP including frame-ancestors and also X-Frame-Options: SAMEORIGIN. It permits inline/eval sources in its current CSP. An Allowed Embed URLs entry alone does not guarantee every browser will allow a cross-origin iframe or that third-party content is isolated safely. Check the target browser's console/network, both response policies and the embedding page's own frame policy. Review external content trust before presenting it within a branded portal.
Cache and changes
The current implementation caches rewritten bodies in Redis for 600 seconds, or 3600 seconds when the entire requested URL ends with a recognized .js, .css, image or SVG extension. A URL ending in an extension followed by a query string does not match that suffix test. The stored cache_settings field is not read by this controller and is not exposed as a cache editor on the reviewed Settings page.
The key includes the incoming host, proxy-setting ID and a slug derived from the URL. It does not include an attendee identity or every response context. Slug normalization is not a guarantee that distinct URLs have distinct cache keys. Use public, cache-compatible content and verify query variants; do not treat the cache as a private per-user response store.
The allowlist is checked before reading the cache. Allowlist changes and upstream-body freshness still answer different questions: a newly allowed request can return an older cached body until its TTL expires. There is no purge control in the reviewed Settings page. Record the setting, URL and observation time for the platform operator rather than repeatedly changing configuration to force freshness.
Acceptance and troubleshooting
| Observation | Check |
|---|---|
| Proxy Settings missing | Correct project, feature/mask, navigation permission mismatch and actual route access |
| Domain not allowed | Parsed hostname versus the saved bare-host list; exact subdomain and lowercase runtime hostname, persisted arrays and any rewritten child URL |
| Saved but request fails | Actual generated slug, correct team/project/API host, valid URL and configured list arrays |
| Upstream content is stale | Effective TTL, query suffix, shared cache key and upstream freshness; a reload need not bypass Redis |
| Page loads but resources fail | Rewriting limits, resource MIME type, child-host allowlist, CSP and absolute requests bypassing the proxy |
| Frame refused | Both sites' CSP/frame policies, SAMEORIGIN header, intended origin/scheme/port and target browser behavior |
| Error page appears successful | Actual upstream response versus the proxy's body/status/content-type behavior |
| Wrong project or unexpected access | Stop distribution; preserve setting/route/principal evidence for binding and middleware acceptance |
Before publishing the integration, test an allowed public host and a denied host, two distinct upstream query values, changed source content across the cache window, relevant child resources and the actual embedded page. Test both intended and excluded embedding origins, unauthenticated runtime access, an allowed administrator and a denied administrator. Missing/invalid project or setting handling is not guaranteed to be a structured 404 by this controller; retain the actual result for the platform team.
Use controlled fixture content for redirect, upstream failure, MIME and cache tests. These instructions do not execute external requests. Verify deployed behavior and destination safety before exposing the real integration; infrastructure, cache administration and incident recovery remain in private runbooks.
Source and verification scope
Reviewed against ProjectProxySetting, dashboard ProxySettingController, store/update requests, ProxySettings list/detail components, navigation/permission configuration, API routing and Api/Ver1/ProxyController at experience-portal 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093. The URL-construction example is checked offline for route shape and nested query encoding. No source server, Redis, browser embed, live credential, redirect destination or tenant-authorization acceptance is implied. Evidence is recorded in repository docs/surface-proxy-review-2026-10-15.md.