Origin Authentication

Close the back door to your server

A firewall only protects the traffic that goes through it. If an attacker finds your server's real IP address, they can skip the firewall and connect to it directly. Origin authentication makes sure your server only answers requests that came through NOC.

Free 14-Day Trial
No credit card required. Included for every site.
A secret NOC-CDN-Auth header on every request NOC sends to your server
One line of nginx or Apache config rejects everything else
One key per site, or one key for all your sites
Regenerate the key any time

How attackers find your server

Old DNS records, a mail server on the same box, a forgotten subdomain or an SSL certificate search are often enough to find a website's real server IP. With that address, an attacker talks to your server directly, and none of your firewall rules apply.

We saw this with PHP2Shell: one server was protected for its main site, but a second hostname on the same box pointed straight at its IP, and that was the way in. Locking the origin closes that door for every site on the server. Read the PHP2Shell article.

Set it up in three steps

1
Turn it on

In the General tab of your site, enable origin authentication. NOC creates a secret key and starts sending it.

2
Add one rule

Copy the ready-made rule for nginx or Apache from the dashboard into your server config.

3
Done

Requests without the header get a 403 from your own server. Only traffic through NOC gets in.

Keys

Key per site
Each site gets its own key. Use it wherever a site owner can read the server config or run code on the server, and when sites live on different servers or belong to different clients.
One key for all sites
Use one account key on every site, so a single rule protects a whole server full of sites. Put it only in server-level config your customers can't read, never in a customer's .htaccess or code.
Regenerate
Create a new key whenever you need to. The old one stops being sent within a few minutes.
Edge IP allow list
For extra protection, also allow only our edge IP addresses in your server's firewall.

The rule for your server

nginx, inside the site's server { } block
if ($http_noc_cdn_auth != "YOUR_KEY") {
    return 403;
}
Apache 2.4, in the VirtualHost or .htaccess
<If "%{HTTP:NOC-CDN-Auth} != 'YOUR_KEY'">
    Require all denied
</If>

The dashboard shows these with your real key filled in, plus a mod_rewrite version for older and shared hosting. Add the rule to your default (catch-all) server or VirtualHost too, so a direct request with an unknown hostname can't land on an unprotected site.

Frequently asked questions

Turning it on in NOC changes nothing for visitors. Add the rule to your server only once the site points to NOC, or every visitor is blocked.

It helps, but other customers of a CDN share the same edge IPs. The header proves the request came from NOC for your site specifically. Using both is best.

Yes. The .htaccess version works on most shared hosting, without access to the server config. Use a per-site key there, since anyone who can read the .htaccess can read the key.

Learn the basics: What is an origin server? · What is a proxy server?

Related features

Security that works, at a price that makes sense

$5per domain per month.

Get access to our full suite of services, including DNS, WAF/CDN and Monitoring, or use only what you need. Our WAF/CDN operates on a distributed anycast network with over 20 data centers, delivering exceptional global performance.

Free 14-Day Trial