Menu
AWS OpsWorks
User Guide (API Version 2013-02-18)

nginx Attributes

Note

These attributes are available only on Linux stacks.

The nginx attributes specify the Nginx configuration. For more information, see Directive Index. For more information on how to override built-in attributes to specify custom values, see Overriding Attributes.

binary

The location of the Nginx binaries (string). The default value is '/usr/sbin/nginx'.

Copy
node[:nginx][:binary]
dir

The location of files such as configuration files (string). The default value is '/etc/nginx'.

Copy
node[:nginx][:dir]
gzip

Whether gzip compression is enabled (string). The possible values are 'on' and 'off'. The default value is 'on'.

Warning

Compression can introduce security risks. To completely disable compression, set this attribute as follows:

Copy
node[:nginx][:gzip] = 'off'
Copy
node[:nginx][:gzip]
gzip_comp_level

The compression level, which can range from 1–9, with 1 corresponding to the least compression (string). The default value is '2'.

Copy
node[:nginx][:gzip_comp_level]
gzip_disable

Disables gzip compression for specified user agents (string). The value is a regular expression and the default value is 'MSIE [1-6].(?!.*SV1)'.

Copy
node[:nginx][:gzip_disable]
gzip_http_version

Enables gzip compression for a specified HTTP version (string). The default value is '1.0'.

Copy
node[:nginx][:gzip_http_version]
gzip_proxied

Whether and how to compress the response to proxy requests, which can take one of the following values (string):

  • 'off': do not compress proxied requests

  • 'expired': compress if the Expire header prevents caching

  • 'no-cache': compress if the Cache-Control header is set to "no-cache"

  • 'no-store': compress if the Cache-Control header is set to "no-store"

  • 'private': compress if the Cache-Control header is set to "private"

  • 'no_last_modified': compress if Last-Modified is not set

  • 'no_etag': compress if the request lacks an ETag header

  • 'auth': compress if the request includes an Authorization header

  • 'any': compress all proxied requests

The default value is 'any'.

Copy
node[:nginx][:gzip_proxied]
gzip_static

Whether the gzip static module is enabled (string). The possible values are 'on' and 'off'. The default value is 'on'.

Copy
node[:nginx][:gzip_static]
gzip_types

A list of MIME types to be compressed (list of string). The default value is ['text/plain', 'text/html', 'text/css', 'application/x-javascript', 'text/xml', 'application/xml', 'application/xml+rss', 'text/javascript'].

Copy
node[:nginx][:gzip_types]
gzip_vary

Whether to enable a Vary:Accept-Encoding response header (string). The possible values are 'on' and 'off'. The default value is 'on'.

Copy
node[:nginx][:gzip_vary]
keepalive

Whether to enable a keep-alive connection (string). The possible values are 'on' and 'off'. The default value is 'on'.

Copy
node[:nginx][:keepalive]
keepalive_timeout

The maximum amount of time, in seconds, that a keep-alive connection remains open (number). The default value is 65.

Copy
node[:nginx][:keepalive_timeout]
log_dir

The location of the log files (string). The default value is '/var/log/nginx'.

Copy
node[:nginx][:log_dir]
user

The user (string). The default values are as follows:

  • Amazon Linux and RHEL: 'www-data'

  • Ubuntu: 'nginx'

Copy
node[:nginx][:user]
server_names_hash_bucket_size

The bucket size for hash tables of server names, which can be set to 32, 64, or 128 (number). The default value is 64.

Copy
node[:nginx][:server_names_hash_bucket_size]
worker_processes

The number of worker processes (number). The default value is 10.

Copy
node[:nginx][:worker_processes]
worker_connections

The maximum number of worker connections (number). The default value is 1024. The maximum number of clients is set to worker_processes * worker_connections.

Copy
node[:nginx][:worker_connections]