Nginx优化配置之开启Gzip

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;
	
    gzip on;
    gzip_static on;
    gzip_min_length 1024;
    gzip_buffers 4 16k;
    gzip_comp_level 2;
    gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
    gzip_vary off;
    gzip_disable "MSIE [1-6]\.";

	
    server {
        listen       80;
        server_name  localhost;


        location / {
            root   /yunsoftware/ngnix;
            index  index.html app.html index.htm;
			add_header Cache-Control no-store;
			try_files $uri $uri/ /index.html;
        }
		

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

你可能感兴趣的:(ops)