Last active
December 16, 2015 11:19
-
-
Save tango238/5426579 to your computer and use it in GitHub Desktop.
chef nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nginx": { | |
"port" : 80 | |
}, | |
"run_list":[ | |
"yum::epel", | |
"nginx" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package "nginx" do | |
action :install | |
end | |
service "nginx" do | |
supports :status => true, :restart => true, :reload => true | |
action [ :enable , :start ] | |
end | |
template "nginx.conf" do | |
path "/etc/nginx/nginx.conf" | |
source "nginx.conf.erb" | |
owner "root" | |
group "root" | |
mode 0644 | |
notifies :reload , 'service[nginx]' | |
end | |
# For Local Environment | |
service 'iptables ' do | |
action [:disable, :stop] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
error_log /var/log/nginx.error_log; | |
events { | |
worker_connections 2000; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
server { | |
listen <%= node['nginx']['port'] %>; | |
server_name localhost; | |
access_log /var/log/nginx.access_log; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment