Nginx 흔 한 매개 변수 최적화 설명

3790 단어 nginx수송 하 다.
### For more information on configuration, see:
###   * Official English Documentation: 
##nginx    
user nginx;
##pid  
pid /run/nginx.pid;
##nginx      ,auto    cpu       .
worker_processes auto;
##  nginx              , ulimit -n(             )      .
worker_rlimit_nofile 65535;
##events     nginx          .
events {
##  worker            ,      socket     .
worker_connections 51200;
## nginx         ,            
multi_accept on;
##Linux2.6+,       IO            .
use epoll;
} 
##HTTP     nginx http         .
http {
##  MIME  
    include /etc/nginx/mime.types;
##          MIME-type
    default_type text/html;
##             
    charset UTF-8;
##      nginx     ,     .
    server_tokens off;
##sendfile        ,        
    sendfile on;
##   sendfile   ,tcp_nopush    ,             ,          
##  Nagle        ,        .
##Tcp_nopush    nginx     packet    HTTP  ,       ##          
    tcp_nopush on;
##  Nagle  ,           .
    tcp_nodelay on;
##    ,  IO
    #	access_log off;
    #	log_format main '[$time_local] ' '$request_uri ' '$status $upstream_addr $upstream_status ' '$upstream_response_time $request_time';
log_format cache '[$time_local] ' '$request_uri ' '$status $upstream_addr $upstream_status ' '$upstream_response_time $request_time';
    #	access_log /var/log/nginx/access.log main;
##            
    error_log /var/log/nginx/error.log;
##                    300 ,      nginx error_page     .
    proxy_intercept_errors on;
##       	
    error_page 404 http://xxx.com/error/404.html;
    error_page 500 502 503 504 http://xxx.com/error/soHot.html;
##keep-alive       ,server           
    keepalive_timeout 13;
##client        keep-alive     ,      ,  100
#	keepalive_requests 65535;
##  server client          ,           
    reset_timedout_connection on;
##  client      ,           ,   60 
    send_timeout 6;
##        key(       )        
    limit_conn_zone $binary_remote_addr zone=addr:24m ;
##    key       ,   IP           
    limit_conn addr 51200;
##  gzip         
    gzip on;
##         gzip  
    gzip_disable "msie6";
##       
	gzip_proxied any;
##               ,  1000     
	gzip_min_length 1000;
##    
	gzip_comp_level 6;
##           
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png image/jpg application/x-javascript image/svg+xml application/x-font-ttf application/vnd.ms-fontobject;
##      ,       	
	open_file_cache max=100000 inactive=20s;
##      	
	open_file_cache_valid 30s;
##inactive              ,        ,      
	open_file_cache_min_uses 2;
##             ,          
	open_file_cache_errors on;#	
	proxy_next_upstream 	off;
##                    。                      ##[error|timeout|invalid_header|http_500|http_502|http_503|http_504|http_404|off]##         ,       ,        	
	proxy_next_upstream_tries 1;
##nginx        ,   1M
	client_max_body_size 	10m;	
	client_body_buffer_size	128k;
##  client  body         ,   "request timed out"  ,  60 ##     ***
	client_body_timeout 	10;	
	client_header_timeout 	10;
#nginx            (      )
	proxy_connect_timeout 	13;	
	proxy_send_timeout 	21;
#           (      )
	proxy_read_timeout 	34; 
#     ,         (      )
	proxy_buffer_size 	64k;
#       (nginx)             
	proxy_buffers 		4 64k;
#proxy_buffers   ,     32k  
	proxy_busy_buffers_size 128k;
#        (proxy_buffers*2)
	proxy_temp_file_write_size 256k;
#         ,     ,  upstream    
#              ,nginx           (   nginx    /proxy_temp  ),      
        server_names_hash_bucket_size	128;	
        client_header_buffer_size 64k;	
        large_client_header_buffers 4 128k;

좋은 웹페이지 즐겨찾기