From 21f580a82beccc146e663d76c3df1bf4cf696cd9 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:20:01 +0100 Subject: [PATCH 01/11] [Rules] Update _redirects SPM-1670 --- public/_redirects | 1 + 1 file changed, 1 insertion(+) diff --git a/public/_redirects b/public/_redirects index 07b10d48849d635..fd5852e2cff5077 100644 --- a/public/_redirects +++ b/public/_redirects @@ -1024,6 +1024,7 @@ /rules/url-forwarding/single-redirects/examples/ /rules/url-forwarding/examples/ 301 /rules/url-forwarding/dynamic-redirects/parameters/ /rules/url-forwarding/single-redirects/settings/ 301 /rules/transform/manage/ /rules/transform/ 301 +/rules/page-rules/how-to/rewrite-host-headers/ /rules/origin-rules/examples/change-uri-path-and-host-header/ 301 # ruleset engine /ruleset-engine/rules-language/fields/standard-fields/ /ruleset-engine/rules-language/fields/reference/ 301 From 6592ef722a859c023d13739336a2961306a556a9 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:21:49 +0100 Subject: [PATCH 02/11] Delete src/content/docs/rules/page-rules/how-to/override-url-or-ip-address.mdx SPM-1670 --- .../how-to/override-url-or-ip-address.mdx | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/content/docs/rules/page-rules/how-to/override-url-or-ip-address.mdx diff --git a/src/content/docs/rules/page-rules/how-to/override-url-or-ip-address.mdx b/src/content/docs/rules/page-rules/how-to/override-url-or-ip-address.mdx deleted file mode 100644 index c8f32ebd47a6a8f..000000000000000 --- a/src/content/docs/rules/page-rules/how-to/override-url-or-ip-address.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -pcx_content_type: how-to -source: https://support.cloudflare.com/hc/en-us/articles/206190798-Using-Resolve-Override-in-Page-Rules -title: Override URL or IP address -head: - - tag: title - content: Override URL or IP address | Page Rules ---- - -import { Render } from "~/components"; - -Cloudflare Page Rules allows you to override the URL or IP address of a request. This feature is currently available for domains on the Enterprise plan. - - - -A common use case for this functionality is when you are serving an application from a particular URI (`mydomain.com/app`). In this case, the app may live on another server and may even be hosted by a third party. Requests to this endpoint must be directed to the server for that third party application. You can specify a `CNAME` host, as long as the `CNAME` record exists within the Cloudflare DNS. - -To make sure you have full control of these records, it is recommended that you set the Resolve Override within the same zone name. - ---- - -To configure a resolve override in Page Rules, do the following: - -1. [Create a DNS record](/dns/manage-dns-records/how-to/create-dns-records/#create-dns-records) (either `CNAME` or `A` record) for your domain. - - - This example shows a `CNAME` record setup to point to `domain.s3.amazonaws.com`. - - - **Type:** `CNAME` - - **Name:** `resolve.example.com` - - **Target:** `domain.s3.amazonaws.com` - - **TTL:** Auto - - **Proxy status:** Proxied - - - This example uses an `A` record to point to a web server IP address. - - - **Type:** `A` - - **Name:** `resolve.example.com` - - **IPv4 address:** `1.2.3.4` - - **TTL:** Auto - - **Proxy status:** Proxied - -2. [Create a page rule](/rules/page-rules/manage/) to override a URL or an IP address. - - The following example page rule configuration would send all requests from a folder (`/app`) to an AWS S3 bucket: - - - **If the URL matches:** `example.com/app/*` - - **Setting:** _Resolve Override_ | **Value:** `resolve.example.com` - - **Setting:** _Host Header Override_ | **Value:** `examplebucket.s3.amazonaws.com` - -:::caution[Important remarks] - -- Page Rules require a [proxied DNS record](/dns/proxy-status/) to work. Page Rules will not apply to subdomains that do not exist in DNS or are not being directed to Cloudflare. - -- The _Resolve Override_ setting only allows override of the hostname, not the path. If you need to modify the path also, you will need to either use a [Worker](/workers/runtime-apis/request/#the-cf-property-requestinitcfproperties) or combine the page rule with a [transform rule](/rules/transform/url-rewrite/). - -::: From 590003600467bda1694c8db995f0fec490c73f85 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:14:05 +0100 Subject: [PATCH 03/11] Update route-production-traffic.mdx --- .../partials/load-balancing/route-production-traffic.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/partials/load-balancing/route-production-traffic.mdx b/src/content/partials/load-balancing/route-production-traffic.mdx index 02124e0289e27cf..3e1b688df82eeb7 100644 --- a/src/content/partials/load-balancing/route-production-traffic.mdx +++ b/src/content/partials/load-balancing/route-production-traffic.mdx @@ -14,7 +14,7 @@ Now that you have set up your load balancer and verified everything is working c :::note -If you have an Enterprise account, also evaluate your application for any excluded paths. For example, you might not want the load balancer to distribute requests directed at your `/admin` path. For any exceptions, set up an [origin rule](/rules/origin-rules/features/#dns-record) or [page rule](/rules/page-rules/how-to/override-url-or-ip-address/). +If you have an Enterprise account, also evaluate your application for any excluded paths. For example, you might not want the load balancer to distribute requests directed at your `/admin` path. For any exceptions, set up an [origin rule](/rules/origin-rules/features/#dns-record). ::: From a67e6b915c56813220c86f01b6382db7c0f8c89f Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:16:21 +0100 Subject: [PATCH 04/11] Update cache-keys.mdx --- src/content/docs/cache/how-to/cache-keys.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/cache/how-to/cache-keys.mdx b/src/content/docs/cache/how-to/cache-keys.mdx index b9114660b5e2012..69e77368c4e09c9 100644 --- a/src/content/docs/cache/how-to/cache-keys.mdx +++ b/src/content/docs/cache/how-to/cache-keys.mdx @@ -120,7 +120,7 @@ Additionally, you cannot include the following headers: Host determines which host header to include in the Cache Key. * If `Use original host` (`resolved: false` in the API), Cloudflare includes the `Host` header in the HTTP request sent to the origin. -* If `Resolved host` (`resolved: true` in the API), Cloudflare includes the `Host` header that was resolved to get the `origin IP` for the request. The `Host` header may be different from the header actually sent if the [Cloudflare Resolve Override](/rules/page-rules/how-to/override-url-or-ip-address/) feature is used. +* If `Resolved host` (`resolved: true` in the API), Cloudflare includes the `Host` header that was resolved to get the `origin IP` for the request. The `Host` header may be different from the header actually sent if it has been changed with an [Origin Rule](/rules/origin-rules/features/#dns-record). ### Cookie From 9916a50afa8c79e0ec9a9a343e83f340ae475988 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:18:01 +0100 Subject: [PATCH 05/11] Update cloudflare-pages-origin.mdx --- .../docs/load-balancing/pools/cloudflare-pages-origin.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/load-balancing/pools/cloudflare-pages-origin.mdx b/src/content/docs/load-balancing/pools/cloudflare-pages-origin.mdx index 2b8b7fb4b4e009e..3f87dc67d52b66a 100644 --- a/src/content/docs/load-balancing/pools/cloudflare-pages-origin.mdx +++ b/src/content/docs/load-balancing/pools/cloudflare-pages-origin.mdx @@ -209,7 +209,7 @@ Now that you have set up your load balancer and verified everything is working c 1. Confirm that your production hostname has the correct [priority order](/load-balancing/load-balancers/dns-records/#priority-order) of DNS records and is covered by an [SSL/TLS certificate](/load-balancing/load-balancers/dns-records/#ssltls-coverage). - If you have an Enterprise account, also evaluate your application for any excluded paths. For example, you might not want the load balancer to distribute requests directed at your `/admin` path. For any exceptions, set up an [Origin rule](/rules/origin-rules/features/#dns-record) or [Page rule](/rules/page-rules/how-to/override-url-or-ip-address/). + If you have an Enterprise account, also evaluate your application for any excluded paths. For example, you might not want the load balancer to distribute requests directed at your `/admin` path. For any exceptions, set up an [Origin rule](/rules/origin-rules/features/#dns-record). 2. Configure your load balancer to receive production traffic by editing the **Hostname** of your existing load balancer. From b5c79ace54da1b9c9efa97d9e904df583924287f Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:20:34 +0100 Subject: [PATCH 06/11] Update settings.mdx --- src/content/docs/rules/page-rules/reference/settings.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/rules/page-rules/reference/settings.mdx b/src/content/docs/rules/page-rules/reference/settings.mdx index b56275f35205623..9ad225f203becaa 100644 --- a/src/content/docs/rules/page-rules/reference/settings.mdx +++ b/src/content/docs/rules/page-rules/reference/settings.mdx @@ -50,7 +50,7 @@ Below is the full list of settings available, presented in the order that they a | Origin Error Page Pass-thru | Turn on or off Cloudflare error pages generated from issues sent from the origin server. If enabled, this setting triggers error pages issued by the origin. | Enterprise | | [Polish](/images/polish/) | Apply options from the **Polish** feature of the Cloudflare **Speed** app. | Pro and above | | [Query String Sort](/cache/advanced-configuration/query-string-sort/) | Turn on or off the reordering of query strings. When query strings have the same structure, caching improves. | Enterprise | -| [Resolve Override](/rules/page-rules/how-to/override-url-or-ip-address/) | Change the origin address to the value specified in this setting. | Enterprise | +| Resolve Override | Change the origin address to the value specified in this setting. | Enterprise | | [Respect Strong ETags](/cache/reference/etag-headers/) | Turn on or off byte-for-byte equivalency checks between the Cloudflare cache and the origin server. | Enterprise | | Response Buffering | Turn on or off whether Cloudflare should wait for an entire file from the origin server before forwarding it to the site visitor. By default, Cloudflare sends packets to the client as they arrive from the origin server. | Enterprise | | [Rocket Loader](/speed/optimization/content/rocket-loader/) | Turn on or off **Rocket Loader** in the Cloudflare **Speed** app. | All | From 00b12779825075103554a6b66890a258601055af Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:21:44 +0100 Subject: [PATCH 07/11] Update index.mdx --- src/content/docs/rules/transform/url-rewrite/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/rules/transform/url-rewrite/index.mdx b/src/content/docs/rules/transform/url-rewrite/index.mdx index 4435823590d01e5..faa17dc5a8dbbb0 100644 --- a/src/content/docs/rules/transform/url-rewrite/index.mdx +++ b/src/content/docs/rules/transform/url-rewrite/index.mdx @@ -20,7 +20,7 @@ Use a URL rewrite to return the content of a URL while displaying a different UR :::caution -You cannot rewrite the hostname using a rewrite URL rule. To rewrite the hostname, use an [origin rule](/rules/origin-rules/) or a [Page Rule](/rules/page-rules/how-to/override-url-or-ip-address/). +You cannot rewrite the hostname using a rewrite URL rule. To rewrite the hostname, use an [origin rule](/rules/origin-rules/features/#dns-record). From 9eed2fe1089a4dc2d46bc28f38dc2573fba296d1 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:27:25 +0100 Subject: [PATCH 08/11] Update _redirects --- public/_redirects | 1 + 1 file changed, 1 insertion(+) diff --git a/public/_redirects b/public/_redirects index fd5852e2cff5077..9a5ba3f3f6a2ca2 100644 --- a/public/_redirects +++ b/public/_redirects @@ -1025,6 +1025,7 @@ /rules/url-forwarding/dynamic-redirects/parameters/ /rules/url-forwarding/single-redirects/settings/ 301 /rules/transform/manage/ /rules/transform/ 301 /rules/page-rules/how-to/rewrite-host-headers/ /rules/origin-rules/examples/change-uri-path-and-host-header/ 301 +/rules/page-rules/how-to/override-url-or-ip-address/ /rules/origin-rules/features/ 301 # ruleset engine /ruleset-engine/rules-language/fields/standard-fields/ /ruleset-engine/rules-language/fields/reference/ 301 From f85c49739596088fde95ffd5690acf6fc3174177 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:28:22 +0100 Subject: [PATCH 09/11] Delete src/content/docs/rules/page-rules/how-to/rewrite-host-headers.mdx --- .../how-to/rewrite-host-headers.mdx | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/content/docs/rules/page-rules/how-to/rewrite-host-headers.mdx diff --git a/src/content/docs/rules/page-rules/how-to/rewrite-host-headers.mdx b/src/content/docs/rules/page-rules/how-to/rewrite-host-headers.mdx deleted file mode 100644 index 481e683b1708416..000000000000000 --- a/src/content/docs/rules/page-rules/how-to/rewrite-host-headers.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -pcx_content_type: how-to -source: https://support.cloudflare.com/hc/en-us/articles/206652947-Using-Page-Rules-to-rewrite-Host-Headers -title: Rewrite Host headers -head: - - tag: title - content: Rewrite Host headers | Page Rules - ---- - -import { Render } from "~/components" - -Customers can rewrite `Host` headers using different Cloudflare rules. This feature is currently available for domains on the Enterprise plan. - - - -A common use case for this functionality is when your content is hosted on an Amazon S3 bucket. Amazon has designed their system to only accept host headers that have the same name as the bucket hosting your content. In this way, a request to `Host: your-domain.com` must be rewritten to `Host: your-bucket.s3.amazonaws.com`, or else the request will be denied. - -In some cases, you can adjust your Amazon S3 Bucket to accept `Host` headers that are not the bucket name. - -*** - -To rewrite the `Host` header: - -1. Log in to your [Cloudflare account](https://dash.cloudflare.com), and select your account and domain. -2. Go to **Rules** > **Page Rules**. -3. Select **Create Page Rule**. -4. Specify the URL to match. -5. In **Pick a Setting,** select *Host Header Override*. Then, enter the override value. -6. Select **Save and Deploy Page Rule**. - -Now, any request matching the URL you specified will have the `Host` header overridden to the one you entered in the **Host Header Override** text box. - - From be3a79e0e3be49657b57166da0088f5f19aef538 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:41:19 +0100 Subject: [PATCH 10/11] Update limit-external-connections-application.mdx --- .../learning-paths/limit-external-connections-application.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/partials/learning-paths/limit-external-connections-application.mdx b/src/content/partials/learning-paths/limit-external-connections-application.mdx index 9b7e85631fc3bca..a29fc826f704e01 100644 --- a/src/content/partials/learning-paths/limit-external-connections-application.mdx +++ b/src/content/partials/learning-paths/limit-external-connections-application.mdx @@ -23,7 +23,7 @@ Only allow traffic with specific (and secret) HTTP headers. * **Challenges**: * Requires more configuration efforts on application- and server-side to accept those headers. * Basic authentication is vulnerable to replay attacks. Because basic authentication does not encrypt user credentials, it is important that traffic always be sent over an encrypted SSL session. - * There might be valid use cases for a mismatch in SNI / Host headers such as through [Page Rules](/rules/page-rules/how-to/rewrite-host-headers/), [Load Balancing](/load-balancing/additional-options/override-http-host-headers/), or [Workers](/workers/runtime-apis/request/), which all offer HTTP Host Header overrides. + * There might be valid use cases for a mismatch in SNI / Host headers such as through [Origin or Page Rules](/rules/origin-rules/features/), [Load Balancing](/load-balancing/additional-options/override-http-host-headers/), or [Workers](/workers/runtime-apis/request/), which all offer HTTP Host Header overrides. * **Process**: 1. Use [Transform rules](/rules/transform/request-header-modification/) or [Workers](/workers/examples/alter-headers/) to add an HTTP Auth Header. 2. Configure your origin server to restrict access based on the [HTTP Auth Header](/workers/examples/auth-with-headers/) (or perform [HTTP Basic Authentication](/workers/examples/basic-auth/)). From 5ba79f8a1434ceba7388c4128f01948da00397f3 Mon Sep 17 00:00:00 2001 From: Nic <123965403+ngayerie@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:43:09 +0100 Subject: [PATCH 11/11] Update settings.mdx --- src/content/docs/rules/page-rules/reference/settings.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/rules/page-rules/reference/settings.mdx b/src/content/docs/rules/page-rules/reference/settings.mdx index 9ad225f203becaa..6d750cd2627a28a 100644 --- a/src/content/docs/rules/page-rules/reference/settings.mdx +++ b/src/content/docs/rules/page-rules/reference/settings.mdx @@ -42,7 +42,7 @@ Below is the full list of settings available, presented in the order that they a | Edge Cache TTL | Specify how long to cache a resource in the Cloudflare global network. *Edge Cache TTL* is not visible in response headers. | All | | [Email Obfuscation](/waf/tools/scrape-shield/email-address-obfuscation/) | Turn on or off **Email Obfuscation**. | All | | Forwarding URL | Redirects one URL to another using an `HTTP 301/302` redirect. Refer to [Wildcard matching and referencing](/rules/page-rules/reference/wildcard-matching/). | All | -| [Host Header Override](/rules/page-rules/how-to/rewrite-host-headers/) | Apply a specific host header. | Enterprise | +| Host Header Override | Apply a specific host header. | Enterprise | | IP Geolocation Header | Cloudflare adds a `CF-IPCountry` HTTP header containing the country code that corresponds to the visitor. | All | | [Mirage](/speed/optimization/images/mirage/) | Turn on or off **Mirage**. | Pro and above | | [Opportunistic Encryption](/ssl/edge-certificates/additional-options/opportunistic-encryption/) | Turn on or off the **Opportunistic Encryption**.  | All |