Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


nginx-proxy (5) Versions 0.1.0

Nginx Proxy

cookbook 'nginx-proxy', '= 0.1.0', :supermarket
cookbook 'nginx-proxy', '= 0.1.0'
knife supermarket install nginx-proxy
knife supermarket download nginx-proxy
Quality -%

nginx-proxy cookbook

Automatically set up Nginx as a proxy to backend application servers
or Apache. Provides a definition to use in recipes, and automatically
configures proxies based on attributes.

This cookbook's home is at


  • nginx
  • apache2 (included only if apache backend is used)


This cookbook provides an nginx_proxy definition that can be used
directly in recipes, and uses it to automatically configure proxies
based on attributes.

To use the definition, include the cookbook in your cookbook's
depends, optionally add recipe[nginx-proxy::setup] to the run
list, and use nginx_proxy in your recipes.

nginx_proxy definition


  • name - name of the file in sites-available/; default value for server_name
  • server_name - server name for nginx
  • ssl_key - basename of SSL key
  • ssl_key_path - full path to SSL private key, defaults to "#{ssl_key}.key" in node['nginx_proxy']['ssl_key_dir']
  • ssl_certificate_path - full path to SSL certificate (full PEM file including intermediate certificates). Defaults to "#{ssl_key}.pem" in node['nginx_proxy']['ssl_certificate_dir]
  • port - port on localhost for the backend
  • apache (value optional) - if provided and true, configure Apache to listen on node['nginx_proxy']['apache_port'] and use it as a backend
  • url - full URL to backend, can be used instead of port or apache
  • redirect - if true, redirect to the url rather than proxy its content
  • aka - can be set to one or more aliases that will redirect to the proxy. Last parameter may be a hash specifying parameters for nginx_proxy calls for the aliases (e.g. SSL keys)


nginx_proxy '' do
  ssl_key ''
nginx_proxy '' do
  url ''
  redirect true
nginx_proxy '' do
  ssl_key ''
  aka '', '',
      ssl_key: ''
nginx_proxy '' do
  url ''
nginx_proxy '' do
  port 4000

Data-driven recipe

If you include nginx-proxy in your run list, it will process the
node['nginx_proxy']['proxies'] attribute hash to call the nginx_proxy
definition: each key will be passed as a name, and values are
interpreted in the following way:

  • if value is 'apache' or :apache, then apache parameter is set
  • if value is a number or a string that is a number, then port parameter is set to the provided value
  • if value is a string that's not a number, then url parameter is set to the value
  • if value is a dictionary, it's applied as parameters


node['nginx_proxy']['proxies'][''] = :apache
node['nginx_proxy']['proxies'][''] = 4000
node['nginx_proxy']['proxies'][''] = ''
node['nginx_proxy']['proxies']['']['apache'] = true
node['nginx_proxy']['proxies']['']['ssl_key'] = '
node['nginx_proxy']['proxies']['']['aka'] = [
  '', '',
  ssl_key: '' ]


  • node['nginx_proxy']['proxies']['…'] -- proxies for data-driven recipe (see above)
  • node['nginx_proxy']['apache_port'] (default: 81) -- port to have Apache listen on when used as a backend
  • node['nginx_proxy']['ssl_key_dir'] (default: /etc/ssl/private) -- directory holding private SSL keys
  • node['nginx_proxy']['ssl_certificate_dir'] (default: /etc/ssl/certificates) -- directory holding public SSL certificates


Author:: Maciej Pasternacki

No quality metric results found