saltstack自动化部署nginx
$ vi /srv/salt/nginx/files/nginx.confuser{{ nginx_user }};
worker_processes {{grains['num_cpus']}}; //grains引用
error_log/opt/log/nginx/nginx_error.logcrit;
pid /opt/run/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
events
{
use epoll;
worker_connections 65535;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
charsetutf-8;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
server_tokens off;
client_body_buffer_size512k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
log_formatwwwlogs'$remote_addr - $remote_user [$time_local] "$request" '$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for' ;
#limit_zonecrawler$binary_remote_addr10m;
include vhost/*.conf;
}
页:
[1]