Nginx 설정 최적화 실전

1144 단어 nginx
1. 최상층
worker_processes  4;
worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile 65535;

#worker_processes  4;Nginx        
#worker_cpu_affinity 0001 0010 0100 1000;4   
#worker_rlimit_nofile 65535;Nginx       

 2、http
        
sendfile        on;
tcp_nopush     on;
#         1024M
client_max_body_size 1024M;
client_body_buffer_size 256k;
underscores_in_headers on;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
#keepalive_timeout  0;
keepalive_timeout  65;
#    
gzip  on;
gzip_min_length 2k;
gzip_buffers   4 32k;    
gzip_comp_level 4;

 3、server
  
	location ~* \.(js|css)$ {
	    expires 1d;
	    log_not_found off;
	    access_log off;
	}

        location /api {
            proxy_pass   http://competition;
	        proxy_set_header  Host $host;
            proxy_set_header   X-real-ip $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
	        proxy_connect_timeout 900s;//504  
    	    proxy_send_timeout 900s;//504  
     	    proxy_read_timeout 900s;//504  
        }

좋은 웹페이지 즐겨찾기