Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use attribute for listen port in nginx default server template #219

Merged
merged 2 commits into from Mar 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions attributes/default.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion 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;
Expand Down