For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, September 29, 2016

How to activate gzip or deflate in Nginx Server

How to activate gzip or deflate in Nginx Server

If you have Nginx server and you deployed a site and seeing site is not producing data as gzip or deflate; it's means the gzip or deflate is not active in your nginx server. so how to activate it? 

The server configuration file name is nginx.conf and it's location is "etc\nginx\" folder.

You needed to put some configuration code, it is listed below:

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

After that configuration restart the server and check and still not working then add below lines too.

gzip_proxied any;
gzip_buffers 16 8k;
gzip_types    text/plain application/javascript application/x-javascript text/javascript text/xml text/css;

gzip_vary on;

*Note that It is not a typo, There is a space between 16 8k;










Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip