diff --git a/README.md b/README.md index 9a2d540a5..cf925c79b 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Generally used attributes. Some have platform specific values. See `attributes/d - `node['nginx']['log_dir']` - Location for Nginx logs. - `node['nginx']['user']` - User that Nginx will run as. - `node['nginx']['group]` - Group for Nginx. +- `node['nginx']['port']` - Port for nginx to listen on. - `node['nginx']['binary']` - Path to the Nginx binary. - `node['nginx']['init_style']` - How to run Nginx as a service when using `nginx::source`. Values can be "runit", "upstart", "init" or diff --git a/attributes/default.rb b/attributes/default.rb index c8a72e874..4344ae229 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -25,6 +25,7 @@ # attributes by modifying a role, or the node itself. default['nginx']['version'] = '1.4.4' default['nginx']['package_name'] = 'nginx' +default['nginx']['port'] = '80' default['nginx']['dir'] = '/etc/nginx' default['nginx']['script_dir'] = '/usr/sbin' default['nginx']['log_dir'] = '/var/log/nginx' diff --git a/templates/default/default-site.erb b/templates/default/default-site.erb index 8ee06d03b..e76812eb3 100644 --- a/templates/default/default-site.erb +++ b/templates/default/default-site.erb @@ -1,5 +1,5 @@ server { - listen 80; + listen <%= node['nginx']['port'] -%>; server_name <%= node['hostname'] %>; access_log <%= node['nginx']['log_dir'] %>/localhost.access.log;