Partner Embeds
Partner embeds let other sites show parts of your app, such as a page in a frame or a script like /embed.js. This page covers the tools Reoclo gives you around them. Each section stands on its own, and the worked example at the end sets all of them up for one app.
| You want to | Use |
|---|---|
| Add security headers without changing your app, except on embed paths | Response headers |
| Stop partners from loading a stale script after a deploy | Purge the Cloudflare cache after a deploy |
| Stop Cloudflare from challenging requests for embed paths | Embeddable paths |
Make Cloudflare follow your own Cache-Control | Respect your app’s cache headers |
| See which partner pages load your embed | Access logs |
| Hear about partners your policy blocks | Framing reports |
| Get alerted when the embed breaks | Monitoring |
Response headers
Section titled “Response headers”Response headers tell the browser how to treat your pages: whether they can be framed, whether the browser may guess content types, how much referrer information to send. Reoclo can add them at the managed proxy, so you do not have to change your app.
Reoclo adds a header only when your app did not send it. If your app sends X-Frame-Options: SAMEORIGIN for a page, visitors get SAMEORIGIN, whatever rule you set. Your app’s own value always wins.
Response headers need the Reoclo managed proxy on the server the domain is bound to. On other servers you can save the rules, but the domain page tells you they are not applied.
Add a header
Section titled “Add a header”- Open the domain, then Settings, then Response headers.
- Add a preset, or choose Add header and fill in the header name and value.
- Optionally list the paths the header should skip in Skip these paths.
- Choose Save response headers.
Reoclo applies the change within a few seconds. A domain holds up to 20 headers.
Skip paths
Section titled “Skip paths”A header with skipped paths is added everywhere except on those paths. This is how you frame-protect your app and still let partners embed one route:
| Header | Value | Skip these paths |
|---|---|---|
X-Frame-Options | DENY | /embed/* |
With this rule, /dashboard gets X-Frame-Options: DENY and /embed/abc gets no X-Frame-Options from Reoclo. The worked example below combines three rules.
A default Content-Security-Policy applies to every path that is not skipped, so skip the same paths as your framing header. Otherwise it still blocks the embed.
Rules for the paths:
- Start each path with
/. Use*as a wildcard, for example/embed/*. - Separate paths with spaces. A header skips up to 10 paths of up to 200 characters.
- Paths are matched without regard to case.
- A path may use letters, digits and these characters:
. _ ~ ! $ & ' ( ) * + , ; = : @ % / -.
Presets
Section titled “Presets”| Preset | Header and value |
|---|---|
| HSTS | Strict-Transport-Security: max-age=300 |
| nosniff | X-Content-Type-Options: nosniff |
| Referrer-Policy | Referrer-Policy: strict-origin-when-cross-origin |
| X-Frame-Options DENY | X-Frame-Options: DENY |
The HSTS preset is deliberately cautious. Once a browser sees HSTS, it refuses plain HTTP for your domain until max-age runs out, and a mistake cannot be undone from your side. The preset uses 5 minutes and leaves out includeSubDomains and preload. Raise the value only after you have confirmed that every subdomain serves HTTPS.
There is no preset for Content-Security-Policy. A default policy can break a working app, so write your own and try it on one path first.
Values and names
Section titled “Values and names”- A value is 1 to 2048 printable ASCII characters. Control characters, non-ASCII characters and the backslash are refused.
- Quotes and braces are allowed and reach the browser exactly as you typed them. A value such as
{env.HOME}is sent as that text; Reoclo does not expand it. - A header name starts with a letter or digit and uses letters, digits and
! # $ % & ' * + - . ^ _| ~`. - Reoclo does not manage these headers:
Set-Cookie,Content-Length,Content-Encoding,Content-Type,Transfer-Encoding,Connection,Keep-Alive,Upgrade,TE,Trailer,Host,Viaand anything starting withProxy-.
Check that it works
Section titled “Check that it works”Request a page and read the headers:
curl -sI https://app.example.com/dashboard | grep -i -E 'x-frame-options|x-content-type-options'curl -sI https://app.example.com/embed/abc | grep -i -E 'x-frame-options|x-content-type-options'To keep checking, add a monitor with response assertions: X-Frame-Options equals DENY on /, and X-Frame-Options is absent on /embed/abc. See Monitoring.
If a change does not apply
Section titled “If a change does not apply”Reoclo checks the new proxy configuration before it replaces the live one. If the check fails, your sites keep serving the previous configuration, and the card shows “Reoclo could not apply your settings” with the reason. Fix the rule and save again.
A server that is offline applies the change when it reconnects.
Purge the Cloudflare cache after a deploy
Section titled “Purge the Cloudflare cache after a deploy”When partner sites load a script or page from your app, for example /embed.js, Cloudflare may keep serving the old copy after you deploy.
After a deploy succeeds, Reoclo purges the paths you list from Cloudflare’s cache on every Cloudflare proxied domain of the app. The purge runs after the deploy is finished and never changes its status. If a purge fails, the deployment stays succeeded and shows the failure as a warning.
Prerequisites
Section titled “Prerequisites”- A Cloudflare API token stored in Reoclo that covers the zone. See Cloudflare Proxied Domains.
- The Zone > Cache Purge > Purge permission on that token. Add it in Cloudflare and keep the token’s zone restriction. Tokens that only issue certificates work as before; the permission is optional and only needed for this feature. See optional token permissions.
- A domain on the app that is proxied by Cloudflare (orange cloud on).
- A connected server assigned to the token whose last check passed. Reoclo makes the Cloudflare call from your server, so a token limited to specific IP addresses must allow that server.
Set it up
Section titled “Set it up”- Open the application and go to Settings.
- In Purge Cloudflare cache after deploy, enter one path per line, for example
/embed.js. - Leave Purge after every successful deploy on, then select Save.
The card lists what a purge would do right now: which domains it would purge and how many URLs, and which proxied domains it would skip and why.
To purge without waiting for the next deploy, select Purge now. It purges again for the latest successful deployment. This is handy after fixing a token or a path list. Purge now needs a successful deployment; without one it tells you to deploy first.
Path rules
Section titled “Path rules”- Start with a single
/. A path may end with a literal query, such as/embed.js?v=3. - No scheme, host, fragment (
#), space or wildcard (*). Each path is purged exactly as written. - At most 30 paths per app, each at most 512 characters.
What gets purged
Section titled “What gets purged”Reoclo builds the URLs from your app’s own domains, as https://<domain><path>. It purges the HTTPS URL only: the Cloudflare cache key includes the scheme, and proxied domains redirect HTTP to HTTPS.
A domain is purged when all of these hold:
- It is active, and bound to this app.
- It is not a wildcard domain and not a redirect.
- Its DNS shows it is proxied by Cloudflare.
- A stored, active Cloudflare token covers its zone, and an assigned server is online.
A proxied domain that fails the last check is skipped, not failed, and the card says why: “not covered by a stored Cloudflare token”, “the Cloudflare token for this zone is not active”, or “no server with this token is online”. An app with no Cloudflare proxied domain shows the purge as skipped. Domains that are not behind Cloudflare, such as a primary domain served directly, are left alone while the proxied aliases are still purged.
Reoclo sends at most 100 URLs per Cloudflare request and at most 3 requests per zone per run, so up to 300 URLs per zone. If Cloudflare answers with HTTP 429, Reoclo waits a few seconds and tries once more.
Read the result
Section titled “Read the result”The deployment panel shows a Cloudflare cache purge section with one outcome and a row per domain:
| Result | Meaning |
|---|---|
| Purged | Every targeted domain was purged. For example, “Purged 3 URLs on 1 domain”. |
| Partly purged | At least one domain was purged and at least one failed. Each row shows its own error. |
| Failed | No targeted domain was purged. For example, “Purge failed: the Cloudflare token does not allow cache purge”. |
| Skipped | Nothing was attempted: the setting is off, no paths are listed, or no domain could be purged. The reason is shown. |
A Cloudflare success means Cloudflare received the request, not that every edge location has already dropped the file.
Check the token permission
Section titled “Check the token permission”Run Check token permissions on the provider under Domains > DNS Providers. Reoclo tests Cache purge by purging one URL that does not exist on your zone, because a refusal on that call is the only way to detect a missing permission. A real purge also updates the stored result: a success marks Cache purge as allowed, and a refusal marks it as denied. See optional token permissions for every permission the check covers.
If the file still looks old
Section titled “If the file still looks old”- A cache rule that matches only
GETcan stop a single-file purge from matching. Make the rule cover the same requests the visitors send. - If your zone uses a custom cache key, the purge request must carry the same headers. Single-file purge by URL does not add them.
- Check the response headers at your domain.
cf-cache-status: HITright after a successful purge points at one of the two cases above.
Embeddable paths
Section titled “Embeddable paths”An embeddable path is a route that partner sites load, such as /embed.js or everything under /embed/. If your domain is behind Cloudflare, its security settings can challenge those requests: a visitor on a partner site sees a challenge page, or the script never loads. Reoclo lets you list the paths, shows what Cloudflare would do to them, and can add one narrow Cloudflare rule so they get through.
Listing the paths changes nothing in Cloudflare. The Cloudflare rule is separate, optional and always asks you to confirm.
List the paths
Section titled “List the paths”- Open the domain, then Settings, then Embeddable paths.
- Enter one path per line.
- Choose Save embeddable paths.
Rules for the paths:
- Start with
/. An exact path such as/embed.jsmatches that path only. - End a path with
/*to match everything below it, for example/embed/*. A*anywhere else is not allowed, and/*alone is refused. - Use letters, digits and these characters:
. _ ~ - /. Paths cannot contain..or//. - A domain holds up to 25 paths of up to 200 characters.
- Cloudflare matches paths exactly, including case. Write each path the way partner sites request it.
Warnings
Section titled “Warnings”Once a path is saved, the card shows what Reoclo found on the zone, when it looked and how. Reoclo checks again when the paths change, once a day, and whenever you choose Check again.
| Warning | What it means | What to do |
|---|---|---|
| Under Attack mode | Security Level is set to Under Attack, which challenges every visitor, embeds included. | Turn it off, or let embeds through with the Cloudflare rule below. |
| Bot Fight Mode | Bot Fight Mode is on. No rule can skip it. | Turn it off in Cloudflare under Security > Bots to embed. |
| Super Bot Fight Mode | Likely or definitely automated traffic is set to challenge or block. | Relax the setting, or use the Cloudflare rule below. |
| Request challenged | A test request from Reoclo to one of your paths was challenged. A browser may be treated differently. | Treat it as a hint and confirm in a real browser. |
| Custom rules challenge | Some of your own custom rules challenge requests. They still apply to these paths. | Exclude the embed paths in those rules. |
| Cannot read settings | Reoclo has no permission to read the zone and the test request told it nothing. | Add the read permissions below to your token. |
Reoclo takes the reading from your Cloudflare token when the token allows it. Add the optional read permissions (Zone Settings Read, Bot Management Read and Zone WAF Read) to get exact settings; see optional token permissions. Without them, Reoclo requests each path itself and looks for a Cloudflare challenge in the answer. Every reading says which of the two it came from and how long ago it was taken.
Let embeds through Cloudflare
Section titled “Let embeds through Cloudflare”Reoclo can add a rule to your Cloudflare zone that lets the listed paths skip the features that challenge visitors.
The rule skips three things, only for the listed paths on your domain: Security Level (Under Attack mode), Browser Integrity Check and Super Bot Fight Mode. It does not skip rate limiting, managed rules, user agent blocking, zone lockdown, hotlink protection or your own custom rules. Bot Fight Mode cannot be skipped by any rule.
You need a stored Cloudflare token that covers the zone and has Zone > Zone WAF > Edit. See Cloudflare Proxied Domains.
- Save at least one embeddable path.
- Choose Allow on Cloudflare.
- Read what the rule does, then type the domain name to confirm.
- Choose Add Cloudflare rule.
Adding a path while the rule is on asks for the same confirmation again. Removing a path does not.
Good to know:
- Reoclo keeps one rule per zone. It lists every domain and path you allowed in that zone, up to 10 domains, and sits first in your custom rules so a challenge rule above it cannot fire first. Its description ends with “managed by Reoclo, do not edit”.
- The rule counts toward the custom rule limit of your Cloudflare plan. If the zone is full, the card says so.
- Saving the same settings again changes nothing. Editing the paths updates the same rule.
- Account level rulesets, available on Enterprise, run before zone rules and are not changed by this rule.
- Changes you make to the rule in Cloudflare are not noticed. To restore it, choose Remove Cloudflare rule, then Allow on Cloudflare.
- Every change is recorded in the audit log: who confirmed it, which domain, which paths and the rule it changed.
Remove the rule
Section titled “Remove the rule”Reoclo removes its rule, and only its own, when you:
- choose Remove Cloudflare rule, or clear all the paths,
- disable, delete or unlink the domain, or delete the application it belongs to,
- delete the Cloudflare token. Reoclo takes the rule down first and turns the setting off on the affected domains.
If the token cannot edit rules, the card shows “The token cannot edit WAF rules. Add Zone, Zone WAF, Edit.” and nothing changes in Cloudflare.
Respect your app’s cache headers
Section titled “Respect your app’s cache headers”Cloudflare decides how long to keep a file in its cache, and how long browsers keep it, by its own settings. Those settings can be longer than the Cache-Control your app sends. A script such as /embed.js that your app serves with max-age=60 may reach partner sites with a much longer lifetime, so a fix takes hours to show up.
A cache rule fixes that for the paths you list. On those paths Cloudflare follows the Cache-Control your app sends, at the edge and in browsers, instead of its own cache TTLs. Purging after a deploy still clears what is cached right now; this rule keeps the lifetime short between deploys.
The rule does not make anything cacheable. A dynamic page stays uncached, and a path whose responses carry no Cache-Control falls back to Cloudflare’s default behavior.
Turn it on
Section titled “Turn it on”You need a stored Cloudflare token that covers the zone and has Zone > Cache Rules > Edit. See Cloudflare Proxied Domains. The permission is optional and only needed for this feature.
- Open the domain, then Settings, then Respect the app’s cache headers.
- Enter one path per line, for example
/embed.js. - Choose Save cache paths.
- Check the paths and the effect shown, then choose Add cache rule.
The paths follow the same rules as embeddable paths: an exact path such as /embed.js, or a prefix ending in /* such as /embed/*. A domain holds up to 25 paths. Cloudflare matches paths exactly, including case.
Adding a path to a list that is already on asks for the confirmation again. Removing a path does not.
What Reoclo adds to your zone
Section titled “What Reoclo adds to your zone”- One cache rule per zone, covering every domain of yours that uses this feature in that zone, up to 10 domains. Its description ends with “managed by Reoclo, do not edit”.
- It is separate from the rule that lets embeds through Cloudflare protection. Changing one never touches the other.
- Saving the same paths again changes nothing. Editing the paths updates the same rule.
- Changes you make to the rule in Cloudflare are not noticed. To restore it, choose Remove cache rule, then save and confirm the paths again.
- Every change is recorded in the audit log: who confirmed it, which domain and which paths.
Check that it works
Section titled “Check that it works”Request the file and read the headers Cloudflare returns:
curl -sI https://example.com/embed.js | grep -i -E "cache-control|cf-cache-status"cache-control should show the lifetime your app sends. A dynamic page under the same rule should still show cf-cache-status: DYNAMIC.
Remove the rule
Section titled “Remove the rule”Reoclo removes its rule, and only its own, when you:
- choose Remove cache rule, or clear all the paths,
- disable, delete or unlink the domain, or delete the application it belongs to,
- delete the Cloudflare token. Reoclo takes the rule down first and turns the setting off on the affected domains.
If the token cannot edit cache rules, the card shows “The Cloudflare token cannot edit cache rules. Add Zone, Cache Rules, Edit to it.” and nothing changes in Cloudflare.
Access logs
Section titled “Access logs”Access logs show which pages and files your domain served, with the status and the referrer. For a partner embed, the referrer is the useful part: it tells you which partner page loaded your frame or your /embed.js. Access logs are off until you turn them on, domain by domain.
Access logs need the Reoclo managed proxy on the server the domain is bound to. Redirect domains do not record a log.
Access logs are one of two switches on the domain’s Traffic and logs card. The other, Traffic analytics, is on by default and only counts requests on your server; it never stores request lines. See Traffic Analytics. The two are independent: you can keep either one, both or neither.
What is recorded
Section titled “What is recorded”Each request becomes one line with:
- the method, the host and the path
- the status code, the response size and the time it took
- the referrer, and the
Sec-Fetch-Destheader, which says whether the browser loaded the request as a frame, a script or a document
Reoclo removes the query string from the path and from the referrer before the line is stored, because a query string can carry a token. It does not record cookies, authorization headers, any other request header, response headers, or the visitor’s IP address.
Turn it on
Section titled “Turn it on”- Open the domain, then Settings, then the Traffic and logs card.
- Switch on Access logs.
- Leave Skip images, scripts and stylesheets on unless you need every file.
- Choose Save changes.
Reoclo applies the change within a few seconds. If the proxy on that server was started before access logs existed, it restarts once so its own log files are capped in size. The card tells you before you save: “Turning this on restarts the proxy on your server once. Connections drop for a few seconds.” Servers with no access log domain are never restarted for this.
Skip static files
Section titled “Skip static files”With the skip switch on, requests for files ending in .js, .css, .png, .jpg, .jpeg, .gif, .svg, .webp, .ico, .woff, .woff2 and .map are not recorded. This keeps the volume down on pages that load many assets.
The paths you mark as embeddable are always recorded, even when they end in .js. Without that rule, a request for /embed.js would vanish from the log, and it is the request whose referrer shows which partner page loads your widget.
Search the logs
Section titled “Search the logs”Access lines are stored with your other logs, under the proxy container reoclo-caddy. Two links open log search already filtered to an app:
- Search access logs on the domain’s Traffic and logs card, once access logs are on.
- Open access logs in the Logs menu on the app page.
The filter matches every active domain of the app, so lines from an alias domain appear next to the primary one. Pick a time range and add line filters as you would for any other log; for example, filter for /embed/ to see only framed requests. An app with no active domain returns no lines.
If no lines appear
Section titled “If no lines appear”- Check the card for a message. A server without the managed proxy, or a domain not linked to an app, records nothing.
- A request for a skipped static file is not recorded. Request an HTML page or an embeddable path.
- Wait a few seconds after saving: the proxy applies the change on its next reconcile.
Framing reports
Section titled “Framing reports”When a partner page tries to frame your app and your Content-Security-Policy forbids it, the visitor sees an empty frame and you hear nothing. Framing reports close that gap. The browser sends a short report to an address Reoclo gives you, Reoclo lists the latest ones on the application page, and an alert tells you when many arrive.
Treat the reports as a hint, not a record. Any browser that holds the address can send one, so a count tells you where to look, not what is certain.
Turn it on
Section titled “Turn it on”- Open the application and go to Settings.
- In Framing reports, switch on Collect framing reports.
- Copy the report URL. It is shown once, so keep it somewhere safe or put it straight into your policy.
- Add the URL to your policy as
report-uriand redeploy. The next section shows how.
Once the collector is on, your app can read the URL from the REOCLO_CSP_REPORT_URL environment variable after the next deploy. Preview environments do not get it. See Variables Reoclo Sets.
Add the URL to your policy
Section titled “Add the URL to your policy”Browsers that understand report-to use it and ignore report-uri; older browsers use report-uri. Send both, together with a Reporting-Endpoints header that names the endpoint. This example lets one partner frame the app and reports every other attempt:
Content-Security-Policy: frame-ancestors https://partner.example; report-uri https://gateway.reoclo.com/csp-report/rcsp_xxxxxxxx; report-to reoclo-cspReporting-Endpoints: reoclo-csp="https://gateway.reoclo.com/csp-report/rcsp_xxxxxxxx"An app that reads the URL from its environment builds the same headers like this:
const reportUrl = process.env.REOCLO_CSP_REPORT_URL;const directives = ["frame-ancestors https://partner.example"];if (reportUrl) { directives.push(`report-uri ${reportUrl}`, "report-to reoclo-csp"); res.setHeader("Reporting-Endpoints", `reoclo-csp="${reportUrl}"`);}res.setHeader("Content-Security-Policy", directives.join("; "));If you would rather not send Reporting-Endpoints from your app, switch on Add the Reporting-Endpoints header when your app sends none in the card. The managed proxy then adds it for you, and only when your app sent none. If your app sends its own, yours wins. This option needs the Reoclo managed proxy on the server, like response headers. The switch saves at once; the proxy applies it within a few seconds.
What is kept
Section titled “What is kept”- Only blocked framings. Reports about any other directive, such as
script-src, are discarded. - Each report records the time, the page that was framed, and the page that tried to frame it when the browser says so. Embedded by shows the site of that page (scheme and host) only when the browser sent a referrer; otherwise it reads Not reported. Browsers differ on which address they report, so check a real case before you rely on it.
- URLs are cut down to the host and path, without query strings or credentials, and long values are shortened.
- Reports are kept for 14 days. The collector accepts a limited number of reports per minute and drops the rest.
Send a test report
Section titled “Send a test report”This request looks like a report from a browser. It answers 204 No Content whether the report was kept or not:
curl -i -X POST "$REOCLO_CSP_REPORT_URL" \ -H 'Content-Type: application/csp-report' \ -d '{"csp-report":{"document-uri":"https://app.example.com/embed/abc","referrer":"https://partner.example/page","blocked-uri":"https://partner.example/page","effective-directive":"frame-ancestors","disposition":"enforce"}}'The collector accepts application/csp-report, application/reports+json and application/json bodies up to 16 KiB. Other content types get 415, larger bodies 413, and an address that is wrong or switched off 404.
The alert
Section titled “The alert”The Framing blocked alert fires as a warning when 10 or more blocked framings arrive within 15 minutes, and as critical at 100 or more. It clears after the reports stop. Route it, mute it or tune its thresholds like any other alert, in notifications.
Rotate the URL
Section titled “Rotate the URL”The URL sits in your policy header, so anyone who loads your page can read it. If someone floods it with reports, choose Rotate URL in the card. The old URL stops accepting reports at once, the new one is shown once, and you put it in your policy and redeploy.
If no reports appear
Section titled “If no reports appear”- Check that Collect framing reports is on and that the URL in your header is the current one. A rotated or switched off URL answers
404. - Redeploy after changing the policy or the variable, so your app sends the new header.
- Test with a real browser on the partner page. Reports come from the visitor’s browser, not from your server.
- A browser that sends no referrer shows Not reported under Embedded by. The report still counts.
Worked example: an embeddable ticket widget
Section titled “Worked example: an embeddable ticket widget”A ticketing company runs its ticket manager as one Reoclo application on tickets.example.com, behind Cloudflare. Partner sites load https://tickets.example.com/embed.js, which injects an iframe of https://tickets.example.com/embed/<key>. The app sends its own Content-Security-Policy: frame-ancestors on the embed pages and should refuse framing everywhere else. The steps below cover the whole setup, in the order that avoids surprises.
1. Give the token the permissions
Section titled “1. Give the token the permissions”The domain already has a Cloudflare token stored in Reoclo for DNS-01. In Cloudflare, add these optional permissions to it, keeping the zone restriction:
- Zone > Cache Purge > Purge, for the purge after a deploy
- Zone > Zone Settings > Read, for the embeddable path warnings
- Zone > Zone WAF > Edit, for the rule that lets the embed through Cloudflare
- Zone > Cache Rules > Edit, for the cache rule
In Reoclo, open Domains > DNS Providers and select Check token permissions. Cache purge and Zone settings read should read allowed. The two write permissions read “learned the first time Reoclo uses it” until the first use. See Cloudflare Proxied Domains.
2. Purge the script after every deploy
Section titled “2. Purge the script after every deploy”Open the application, then Settings, then Purge Cloudflare cache after deploy. Enter one path:
/embed.jsLeave Purge after every successful deploy on and select Save. The card lists https://tickets.example.com/embed.js as the URL a purge would clear. Purge paths take no wildcard, and the /embed/<key> pages are generated per request, so the script is the only file that needs it.
Deploy once. The deployment shows Cloudflare cache purge with “Purged 1 URL on 1 domain”.
3. Set the response headers
Section titled “3. Set the response headers”Open the domain tickets.example.com, then Settings, then Response headers, and add three rules:
| Header | Value | Skip these paths |
|---|---|---|
X-Content-Type-Options | nosniff | none |
X-Frame-Options | DENY | /embed/* |
Content-Security-Policy | default-src 'self'; frame-ancestors 'none' | /embed/* /embed.js |
Select Save response headers. The result:
/dashboardgets all three headers./embed/abcgetsX-Content-Type-Optionsonly./embed.jsgetsX-Content-Type-OptionsandX-Frame-Options.
Reoclo adds a header only when the app sent none, so the per-embed frame-ancestors policy the app sends on /embed/* is never replaced. The skipped paths protect the case where the app sends nothing on an embed route.
curl -sI https://tickets.example.com/embed/abc | grep -i -E 'x-frame-options|content-security-policy'The command should print the app’s own content-security-policy line and no x-frame-options line.
4. List the embeddable paths
Section titled “4. List the embeddable paths”On the same domain, open Embeddable paths, enter two paths and select Save embeddable paths:
/embed.js/embed/*Read the warnings. If Cloudflare reports Under Attack mode, Super Bot Fight Mode or a challenged request, choose Allow on Cloudflare, read the dialog, type tickets.example.com and select Add Cloudflare rule. If it reports Bot Fight Mode, turn that off in Cloudflare, because no rule can skip it.
5. Respect the app’s cache headers on the script
Section titled “5. Respect the app’s cache headers on the script”Open Respect the app’s cache headers, enter the one path and select Save cache paths, then Add cache rule:
/embed.jsThe app serves the script with Cache-Control: public, max-age=60. With the rule on, partners get that lifetime instead of Cloudflare’s own, and the purge from step 2 clears whatever is cached at deploy time. Check it:
curl -sI https://tickets.example.com/embed.js | grep -i -E 'cache-control|cf-cache-status'6. Record access logs
Section titled “6. Record access logs”Open the Traffic and logs card on the domain, switch on Access logs, keep Skip images, scripts and stylesheets on and select Save changes. If this is the first access log on the server, Reoclo warns that the proxy restarts once; confirm a quiet moment first.
The skip switch drops .js files, but /embed.js is an embeddable path, so it is still recorded. Select Search access logs and filter for /embed/ to see each framed request with its referrer and Sec-Fetch-Dest. The referrer shows which partner page loaded the widget.
7. Collect framing reports
Section titled “7. Collect framing reports”Open the application, then Settings, then Framing reports, switch on Collect framing reports and copy the URL. It is shown once. Add it to the policy the app already sends on /embed/*:
Content-Security-Policy: frame-ancestors https://partner.example; report-uri https://gateway.reoclo.com/csp-report/rcsp_xxxxxxxx; report-to reoclo-cspReporting-Endpoints: reoclo-csp="https://gateway.reoclo.com/csp-report/rcsp_xxxxxxxx"Or read it from REOCLO_CSP_REPORT_URL, as shown in Add the URL to your policy. Redeploy. When a page that is not on the allowed list tries to frame an embed, the card lists the report with Embedded by set to that page’s site, and the Framing blocked alert fires at 10 reports in 15 minutes.
8. Monitor it
Section titled “8. Monitor it”Create three monitors on https://tickets.example.com (see Monitoring):
| Path | Assertions |
|---|---|
/ | x-frame-options must equal DENY |
/embed/<key> (a real embed key) | x-frame-options must be absent; content-security-policy must contain frame-ancestors https://partner.example |
/embed.js | Response must contain the current version marker; cache-control must contain max-age=60 |
The first two catch a proxy or a deploy that drops or rewrites the framing headers. The third catches a stale script that a purge missed. See Catch a stale cache.