ycvodzf 发表于 2018-1-3 12:30:56

使用Ansible安装部署nginx+php+mysql之安装nginx(1)

usernginx nginx;  

worker_processesauto;  

worker_cpu_affinity auto;  

  
error_log/var/log/nginx/error.log warn;
  

pid      /var/run/nginx.pid;  

  
events {
  
   use epoll;
  
   multi_accept off;
  
   accept_mutex off;
  
   worker_connections65535;
  
}
  

  
http {
  
   include       mime.types;
  
   default_typeapplication/octet-stream;
  

  
   log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
  
                     '$status $body_bytes_sent "$http_referer" '
  
                     '"$http_user_agent" "$http_x_forwarded_for"';
  

  
   access_log/var/log/nginx/access.logmain;
  

  
   server_names_hash_bucket_size 128;
  
   client_body_timeout 15;
  
   send_timeout 15;
  
   large_client_header_buffers 4 32k;
  
   client_max_body_size 8m;
  
   client_header_buffer_size 128k;
  
   client_header_timeout 15;
  

  
   charset UTF-8;
  
   server_tokens off;
  

  
   sendfileon;
  
   sendfile_max_chunk 512k;
  

  
   tcp_nopushon;
  
   tcp_nodelay on;
  

  
   keepalive_timeout60;
  
   keepalive_requests 100000;
  
   reset_timedout_connection on;
  

  
   fastcgi_connect_timeout 300;
  
   fastcgi_send_timeout 300;
  
   fastcgi_read_timeout 300;
  
   fastcgi_buffer_size 64k;
  
   fastcgi_buffers 4 64k;
  
   fastcgi_busy_buffers_size 128k;
  
   fastcgi_temp_file_write_size 128k;
  

  
   gzipon;
  
   gzip_min_length10240;
  
   gzip_buffers   4 16k;
  
   gzip_http_version 1.1;
  
   gzip_proxied expired no-cache no-store private auth;
  
   gzip_disable "MSIE .";
  
   gzip_comp_level 2;
  
   gzip_types   text/plain text/css text/xml text/javascriptapplication/json application/x-javascript application/xml application/xml+rss;
  
   gzip_vary on;
  

  
   open_file_cache max=102400 inactive=20s;
  
   open_file_cache_valid 30s;
  
   open_file_cache_min_uses 1;
  
   open_file_cache_errors on;
  

  
   include /etc/nginx/conf.d/*.conf;
  

  
}
页: [1]
查看完整版本: 使用Ansible安装部署nginx+php+mysql之安装nginx(1)