In some scenarios, it's good practice to force SSL connections on some or all CDN assets. This article contains a definition of a rule that will enable forced SSL for requests to any CDN file or location. We can make this a flexible option by defining a variable for the SSL destination, which will then be enabled for all requests.
The EdgeRules feature is available only on Enterprise plans.
Creating the Rule
Verifying the Rule
Curl Using HTTP Connection Type To Non-SSL URL
curl -I http://foo.bar.netdna-cdn.com/fav.ico
HTTP/1.1 301 Moved Permanently
Date: Sun, 26 Jan 2014 05:32:43 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: https://foo-bar.netdna-ssl.com/file.png
Server: NetDNA-cache/2.2
Curl Using HTTPS Connection Type to SSL URL
curl -I https://foo-bar.netdna-ssl.com/fav.ico
HTTP/1.1 200 OK
Date: Sun, 26 Jan 2014 05:39:57 GMT
Content-Type: image/x-icon
Content-Length: 1698
Connection: keep-alive
Last-Modified: Wed, 11 Sep 2013 22:38:35 GMT
X-Type: static/known
Cache-Control: public, max-age=2592000
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Server: NetDNA-cache/2.2
X-Cache: HIT
Accept-Ranges: bytes
Resulting Nginx Configuration Block
location / {
set $server foo-bar.netdna-ssl.com;
if ($server_port = 80) {
rewrite ^ https://$server$request_uri permanent;
}
We hope this article was helpful and as always, If there are any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!