# Chef\_nginx - SSL certificate and key?

**URL:** <https://discourse.chef.io/t/chef-nginx-ssl-certificate-and-key/11059>\
**Category:** Chef Infra (archive)\
**Created:** [June 22, 2017, 8:04am UTC](https://discourse.chef.io/t/chef-nginx-ssl-certificate-and-key/11059 "2017-06-22T08:04:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Skwar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/alexander_skwar/32/1205_2.png) [@Alexander\_Skwar](https://discourse.chef.io/u/Alexander_Skwar)\
**Post date:** [June 22, 2017, 8:04am UTC](https://discourse.chef.io/t/chef-nginx-ssl-certificate-and-key/11059/1 "2017-06-22T08:04:45Z")

</div>

Hello

Using the [chef\_nginx @ supermarket](https://supermarket.chef.io/cookbooks/chef_nginx), how do you specify which SSL certificate is to be used?

And also, how do you set the key for the SSL certificate? As we store our cookbooks and such on an internal Git repo, I don’t feel too comfortable, saving the key there in an unencrypted format.

If I were to roll my own cookbook, I’d use encrypted databags, I suppose. But in chef\_nginx?

We’re using chef-zero v12.19.36 on Ubuntu. No Chef Server.

Thanks,  
Alexander

---

<div class="post-metadata">

**Author:** ![joerg.herzinger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joerg.herzinger/32/1514_2.png) [@joerg.herzinger](https://discourse.chef.io/u/joerg.herzinger)\
**Post date:** [June 22, 2017, 8:52am UTC](https://discourse.chef.io/t/chef-nginx-ssl-certificate-and-key/11059/2 "2017-06-22T08:52:14Z")

</div>

The nginx cookbook itself does not deal with this, but there are some other cookbooks offering solutions. I’ve had good experiences with the ssl\_certificate cookbook which also has an example of how to use it with the nginx cookbook: [https://github.com/zuazo/ssl\_certificate-cookbook#nginx-example](https://github.com/zuazo/ssl_certificate-cookbook#nginx-example)  
Chef Vault can encrypt your DataBags and will also work with chef-zero.
