Cloudinary supports delivery of all media assets using either HTTP or HTTPS.
Cloudinary delivers media assets using a mix of multiple CDN providers (Akamai, Fastly, and Cloudflare). For HTTP delivery http://res.cloudinary.com is used, for HTTPS the base URL is https://res.cloudinary.com.
For example:
HTTP: http://res.cloudinary.com/demo/image/upload/sample.jpg
HTTPS: https://res.cloudinary.com/demo/image/upload/sample.jpg
If you have a paid Cloudinary account with a plan that supports a private CDN distribution, the hostname used will be different and is based on your account's cloud name.
Delivery via a custom hostname is also possible, with an additional add-on available for provisioning and maintenance of certificates for HTTPS delivery on our CDN providers.
For more information, please see our documentation for Private CDNs and CNAMES
If you use one of our client SDKs (Ruby, PHP, NodeJS, etc.), the URLs of images are built automatically using the correct domain based on how the SDK was configured. You can add :secure => true in the SDK config or calls to methods like cl_image_tag and cloudinary_url to request an HTTPS URL.
For example in NodeJS:
cloudinary.url("sample")
> http://res.cloudinary...../sample
cloudinary.url("sample", {secure: true})
> https://res.cloudinary...../sample
Comments
9 comments
I have not had success in Rails 4 getting Cloudinary to serve images via https.
I have tried secure: true in cloudinary.yml, image_tag, cl_image_tag and also tried to define an cloudinary.rb initialization without success.
I have not had any success in Rails4 either setting secure: true in cloudinary.yml,
Here is my yml..
development:
cloud_name: mycloudname
api_key: 'key'
api_secret: secret
enhance_image_tag: true
static_image_support: false
secure: true
production:
cloud_name: mycloudname
api_key: 'key'
api_secret: secret
enhance_image_tag: true
static_image_support: false
secure: true
Any ideas would be appreciated.
Adding 'secure: true' to the cloudinary.yml file worked fine for me. Don't forget to restart your server to pick up the change.
Adding 'secure: true' doesn't work for me. Not sure if updating gem will help.
I'm using rails4-2.2 and cloudinary-1.2.2.
To add secure option Into config/initializer/cloudinary.rb instead of cloudinary.yml, it works for me.
# config/initializer/cloudinary.rb
Cloudinary.config do |config|
config.secure = true
end
# carrierwave integration code
Post.find(1).image.url
"https://res.cloudinary.com/spacemarket/image/upload/vxxxxxxxxxx/image.jpg"
Hi. I have the next image: http://res.cloudinary.com/pym/image/upload/c_scale,w_600/v1507704935/series/desarrollo-php-mysql_yhre8b.png
It is served right using http, however the image doesn't load when using https: https://res.cloudinary.com/pym/image/upload/c_scale,w_600/v1507704935/desarrollo-php-mysql_yhre8b.png
It happens usually?
Some days I can see the images loading well, but in others times they are off.
Hi Juan,
There is no resource named 'desarrollo-php-mysql_yhre8b' in account 'pym', and therefore you get an 404 error. You might have seen a cached resource occasionally.
You are right Roee. Thank you.
Yesterday I created a new folder and moved some of my images.
I was thinking "the URL will be the same because it contains an ID and it just allows me to organize my images". But I see that the resource name changes if the image is moved.
Thank you. My images are showing again.
Addind secure: true to my cloudinary.yml file worked for me. Thx for the help :D
Please sign in to leave a comment.