5centsCDN

Experience our sturdy EdgeRules feature

Have a full control over how your content is delivered from the pull zone by customizing asset delivery

Unlock a 15-days Trial with our 24/7 customer support to help you.

Curved Background

Take full control over your content with edgerules

Recipes

Designed to help you get started with EdgeRules, our recipes provide you with predefined rules for the most common cases.

Recipes

Origin Server Optimization

Manipulate headers, reduce the number of calls made to your origin server, create custom redirects, and more.

Origin Server Optimization

Go Mobile

Create a better user experience by providing separate caches for mobile and non-mobile devices.

Go Mobile

Technical Details

Creating a custom Edgerule

You can create 100% custom Edgerules or use and modify other elements shown here. Explore following options laid out in a simple, user friendly format:

Arrow

Match type: e.g. Exact, Literal (and many more)

Arrow

Match location: The URI

Arrow

Match location case sensitive: yes or no

Arrow

Directive: e.g. Status code, Ignore query string, Deny (many more plus custom directives)

Arrow

Directive value

Arrow

Optional conditional: $variable and Relational operator (and value)

Arrow

Multiple sets of directives and conditionals (points 4-6)

Arrow

Rule priority

Arrow

Purge cache: yes or no

Arrow

Realtime activation or save and finish later

HideX powered by Header

Some applications add this header to all HTTP responses and it often contains the application name and version which can be a security risk. This recipe allows you to hide it.

Match Type Default

Features HIDE HEADER X-Powered-By

Hide S3 Headers

Amazon S3 by default adds lots of useless to the user HTTP headers. You can remove them to minimize the transferred data.

Match Type Default

Features HIDE HEADER x-amz-id-2

HIDE HEADER x-amz-meta-s3fox-filesize

HIDE HEADER x-amz-meta-s3fox-modifiedtime

HIDE HEADER x-amz-request-id

Add X-XSS-Protection Header

X-XSS-Protection is an HTTP header understood by Internet Explorer 8 (and newer versions). This header lets domains toggle on and off the “XSS Filter” of IE8, which prevents some categories of XSS attacks.

Match Type Default

Features ADD HEADER X-XSS-Protection “1; mode=block”

Block By Country

This will allow the customer to block certain Countries. In this example, we will return a 403 when a visitor is coming from China (CN).

Match Type Default

Features if ( $geoip_city_country_code = CN ) {

STATUS CODE 403 }

Redirect All Bots

To improve your SEO scores you can redirect all bots that hit the CDN to your origin.

Match Type Exact

Features if ( $http_user_agent ~*

~(crawl|Googlebot|Slurp|spider|

bingbot|tracker|click|parser|spider) ) {

REWRITE RULE ^ https://static.origin.com$request_uri permanent

}

Add X-Pull Request Header

Specify a X-Pull request header key to have the possibility to restrict access to your origin server (X-Pull: [key])

Match Type Default

Features if ($http_x_pull ~* “Your_secret_key”) {

return 405;}

HLS .M3u8

Caching will be disabled for index file .m3u8

Match Type Regex

Features if (Location .m3u8 ) {

BYPASS CACHE 1

}

Add X-Robots-Tag

You can use this recipe to disallow bots to index different parts of your website. A flexible alternative to robots.txt file.

Match Type Regex

Location .(?:pdf|htm?l|png|jpe?g|gif)$

Features ADD HEADER X-Robots-Tag “noindex”

ADD HEADER X-Robots-Tag “googlebot: nofollow”

Add X-Frame-Options Header

This header can be used to indicate whether or not a browser should be allowed to render a page in a <frame> or <iframe>

Match Type Default

Features ADD HEADER X-Frame-Options SAMEORIGIN

ADD HEADER X-Frame-Options DENY

ADD HEADER X-Frame-Options “ALLOW-FROM $uri”

CORS Headers

Cross-Origin resource sharing allows other websites to request content from your domain using JavaScript or CSS. Required for web fonts to work.

Match Type Regex

Location .(ttf|ttc|otf|eot|woff|font.css|css)$

Features ADD HEADER Access-Control-Allow-Origin “*”

Hide Server Header

This recipe allows you to hide the Server header from all HTTP responses.

Match Type Default

Features HIDE HEADER Server

Force HTTPS Connections

Forces the use of HTTPS connections. All HTTP requests will be redirected to HTTPS.

Match Type Default

Features if ( $scheme = http ) {

REWRITE RULE ^ https://$http_host$request_uri permanent

}

Redirect By Referrer

You can redirect all users that come from a specific website. This rule can be used to ban websites that steal bandwidth or show different content from visitors from other websites.

Match Type Exact

Location /example.html

Features if ( $http_referer ~ https://domain.com ) {

REWRITE RULE ^ https://example.com/banned.html permanent

}

Redirect By Country

This will allow the customer to redirect to certain Countries. In this example, we will redirect users from the United States and the United Kingdom to an English version of the website they are visiting.

Match Type Default

Features if ( $geoip_city_country_code ~* (US|UK) ) {

REWRITE RULE ^ https://english.$http_host$request_uri$1 permanent

}

HLS .Ts (Live)

This will allow the ts file .ts to be cached for 60 second

Match Type Regex

Features if ( Location .ts ) {

IGNORE QUERY STRING 1

TTL OVERRIDE 60s

ADD HEADER Cache-Control max-age=60

}

HLS .Ts (VOD)

The ts file .ts will be cached for 3600 second

Match Type Regex

Features if (Location .ts ) {

IGNORE QUERY STRING 1

TTL OVERRIDE 3600s

ADD HEADER Cache-Control max-age=3600

}

Add Canonical Header

Allows you to specify the original domain that should be attributed with the SEO score instead of the CDN accelerated one.

Match Type Regex

Location .(?:pdf|htm?l|png|jpe?g|gif)$

Features ADD HEADER

Give Your Customers The Best Viewing Experience.

Products

Solutions

Feature

Pricing

Compare

Resources

Company

Support

Subscribe to our newsletter

A monthly digest of the latest 5centsCDN news, articles and resources.

Fast and Easy Soultions at Your Command with a Simple Click

© 5centsCDN Inc 2024

LinkedInFacebookInstagramTwitterWhatsApp