Nginx configuration page to achieve compression!

The Nginx nginx_http_gzip_module compression provides file content compression function allows Nginx server outputting content 2 transmits compressed before client, so that the file content becomes smaller transmission speed becomes faster, in order to save bandwidth the site to enhance the user experience, The default module has been installed!

[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf

Copy the code
 gzip on;
    gzip _min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 2;
    gzip_types text/plain text/javascript application/x-javascrip t text/css text/xml
application/xml application/xml+rss;
Copy the code

[root@localhost ~]# nginx -t

[root@localhost ~]# killall -s HUP nginx

 


Guess you like

Origin www.cnblogs.com/L1-5551/p/11518555.html