Note: only one redirect option can be enabled on a CDN Resource.
You can redirect HTTP traffic to HTTPS via API (more info in the API documentation) or in the control panel.
To enable the redirect option in the control panel, go to the CDN Resources settings:
1. Get a free Let’s Encrypt certificate or add your SSL certificate in the General -> SSL section and save changes. More info in the guide “Add a SSL certificate to transfer content over HTTPS”.
2. Go to the Access -> Redirect HTTP to HTTPS section, enable the option and save changes.
The error “You cannot enable redirect HTTP to HTTPS when HTTPS is disabled. Please enable HTTPS and add SSL certificate first” means that you didn't add a certificate or that the issuing of a Let’s Encrypt certificate for your account wasn’t completed. As usual it takes about 15 minutes.