{"id":8054,"date":"2023-08-03T09:43:27","date_gmt":"2023-08-03T09:43:27","guid":{"rendered":"https:\/\/www.infinitivehost.com\/knowledge-base\/?p=8054"},"modified":"2023-08-03T09:43:29","modified_gmt":"2023-08-03T09:43:29","slug":"how-to-configure-gzip-compression-with-nginx","status":"publish","type":"post","link":"https:\/\/www.infinitivehost.com\/knowledge-base\/how-to-configure-gzip-compression-with-nginx\/","title":{"rendered":"How to configure gzip compression with NGINX?"},"content":{"rendered":"<div class='epvc-post-count'><span class='epvc-eye'><\/span>  <span class=\"epvc-count\"> 2,334<\/span><span class='epvc-label'> Views<\/span><\/div>\n<p class=\"wp-block-paragraph\">1. Go to terminal and login via ssh root\/user.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"868\" height=\"61\" src=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image2-7.png\" alt=\"How to configure gzip compression with NGINX?\" class=\"wp-image-8056\" srcset=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image2-7.png 868w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image2-7-300x21.png 300w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image2-7-768x54.png 768w\" sizes=\"(max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. Go to Nginx configuration file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"496\" height=\"44\" src=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image1-6.png\" alt=\"How to configure gzip compression with NGINX?\" class=\"wp-image-8057\" srcset=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image1-6.png 496w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image1-6-300x27.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Note: If you have more then one sites( separate vhost), then go to \/etc\/nginx\/sites-enabled\/yoursite.conf and add or uncomment all below lines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># Gzip Settings<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gzip on;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">gzip_vary on;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp; gzip_proxied any;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp; gzip_comp_level 6;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp; gzip_buffers 16 8k;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp; gzip_http_version 1.1;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gzip_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"134\" src=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image5-3-1024x134.png\" alt=\"Gzip Settings\" class=\"wp-image-8058\" srcset=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image5-3-1024x134.png 1024w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image5-3-300x39.png 300w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image5-3-768x101.png 768w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image5-3.png 1297w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">wq!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save file and quite.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Run the below command to check syntax of your update config file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"84\" src=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image4-6.png\" alt=\"Run the below command to check syntax of your update config file\" class=\"wp-image-8059\" srcset=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image4-6.png 716w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image4-6-300x35.png 300w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4. Now restart the service of Nginx.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"580\" height=\"55\" src=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image3-5.png\" alt=\"Now restart the service of Nginx\" class=\"wp-image-8060\" srcset=\"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image3-5.png 580w, https:\/\/www.infinitivehost.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/image3-5-300x28.png 300w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>2,334 Views 1. Go to terminal and login via ssh root\/user. 2. Go to Nginx configuration file. Note: If you have more then one sites( separate vhost), then go to \/etc\/nginx\/sites-enabled\/yoursite.conf and add or uncomment all below lines. # Gzip Settings &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gzip on; gzip_vary on; &nbsp;&nbsp; gzip_proxied any; &nbsp;&nbsp; gzip_comp_level 6; &nbsp;&nbsp; gzip_buffers 16 8k; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,64],"tags":[],"class_list":["post-8054","post","type-post","status-publish","format-standard","hentry","category-web-hosting","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=8054"}],"version-history":[{"count":2,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8054\/revisions"}],"predecessor-version":[{"id":8061,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8054\/revisions\/8061"}],"wp:attachment":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=8054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=8054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=8054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}