{"id":1959,"date":"2020-10-27T05:57:06","date_gmt":"2020-10-27T05:57:06","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=1959"},"modified":"2025-10-31T06:35:09","modified_gmt":"2025-10-31T06:35:09","slug":"how-to-enable-nginx-gzip-compression","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/","title":{"rendered":"How to Enable NGINX Gzip  Compression"},"content":{"rendered":"\n<p>Every site administrator and web developer wants to make their website run faster. One of the most powerful ways to do this is to compress the files and data sent from the web server to client browser. GZIP compression allows NGINX server to compress data before sending it to client browser. This reduces data bandwidth, improves website speed and saves server costs. In this article, we will learn how to enable NGINX GZip compression.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#What_is_GZIP_Compression_in_NGINX\" >What is GZIP Compression in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#Why_Enable_GZIP_Compression\" >Why Enable GZIP Compression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#How_to_Enable_NGINX_Gzip_Compression\" >How to Enable NGINX Gzip Compression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#1_Open_NGINX_Configuration_file\" >1. Open NGINX Configuration file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#2_Enable_GZIP_Compression_in_NGINX\" >2. Enable GZIP Compression in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#3_Restart_NGINX_Server\" >3. Restart NGINX Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#4_Verify_GZIP_Compression\" >4. Verify GZIP Compression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_GZIP_Compression_in_NGINX\"><\/span>What is GZIP Compression in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By default, when a web browser sends a request to web server, it returns all the response data as it is. Since today&#8217;s web pages are content heavy and require many files (images, css, js, etc.), this can slow down your website. When you enable GZIP compression on your web server, then it will automatically compress all the response data sent to client browser, using GZIP compression algorithm. It will also set the &#8216;content-encoding&#8217; response header to &#8216;gzip&#8217;. When the web browser receives the response data, it will see this response header and automatically decompress the data using the same GZIP algorithm, before rendering it for the end user. <br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Enable_GZIP_Compression\"><\/span>Why Enable GZIP Compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If there are too many files requested on a web page or a large amount of data is to be transferred, this can slow down your website and also increase network bandwidth costs. Therefore, it is practical to compress the response data sent by the server as much as possible. This will load your web pages faster and reduce data transfer costs. There are several data compression algorithms for this purpose. Among them, GZIP is one of the most popular. GZIP compression is supported by most web servers and browsers. So it is easy to switch it on your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Enable_NGINX_Gzip_Compression\"><\/span>How to Enable NGINX Gzip Compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to enable NGINX GZip compression.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_NGINX_Configuration_file\"><\/span>1. Open NGINX Configuration file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can enable GZIP compression via main config file or virtual host file, depending on your setup. Open terminal and run the following command to open NGINX server configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/nginx\/nginx.conf<\/pre>\n\n\n\n<p>If you have configured separate virtual hosts for your website (e.g www.example.com), such as \/etc\/nginx\/sites-enabled\/website.conf then open its configuration with the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi&nbsp;\/etc\/nginx\/sites-enabled\/website.conf<\/pre>\n\n\n\n<p>Bonus Read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/\">How to Enable Browser Caching in NGINX<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Enable_GZIP_Compression_in_NGINX\"><\/span>2. Enable GZIP Compression in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Add\/Uncomment the following lines in your NGINX configuration file, or add them to http or server block, as per your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server{<br>    gzip on; <br>    gzip_vary on; <br>    gzip_min_length 1024; <br>    gzip_proxied expired no-cache no-store private auth; <br>    gzip_types text\/plain text\/css text\/xml text\/javascript application\/x-javascript application\/xml; <br>    gzip_disable \"MSIE [1-6]\\.\";<br>}<\/pre>\n\n\n\n<p>Let us look at each of the above lines<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>gzip on &#8211; turns on gzip compression<\/li>\n\n\n\n<li>gzip_vary on &#8211; enable gzip for both gzipped and regular versions of a file<\/li>\n\n\n\n<li>gzip_min_length &#8211; compress files that are larger than 1024 bytes (1kb). Small files cannot be compressed much.<\/li>\n\n\n\n<li>gzip_proxied &#8211; compress data even for users connected via proxies<\/li>\n\n\n\n<li>gzip_types &#8211; specifies the file types to be compressed<\/li>\n\n\n\n<li>gzip_disable &#8211; disable gzip for IE browser versions 1-6, since they do not support GZIP compression<\/li>\n<\/ul>\n\n\n\n<p>Please note, using the gzip_types server directive you can easily control the file types to be compressed.<\/p>\n\n\n\n<p>The above configuration &#8216;gzip on&#8217; directive on entire website. If you want to exclude GZIP compression for certain URLs, you can add &#8216;gunzip on&#8217; directive to their location blocks. Here is an example to exclude \/files\/ from data compression.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/files\/ {<br>    gunzip on;<br>    ...<br>}<\/pre>\n\n\n\n<p>Also, in the above case, NGINX will compress all your responses on the fly. If you already have compressed data that you want to send, instead of compressing data on the fly, use gzip_static directive for the specific file location block, instead of using &#8216;gzip on&#8217; directive.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/ {<br>    gzip_static on;<br>}<\/pre>\n\n\n\n<p>In the above example, when a user requests \/file.txt, NGINX will look for \/file.txt.gz and directly send it instead of compressing it and sending it. If the file is not found, then it will send the uncompressed file.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_NGINX_Server\"><\/span>3. Restart NGINX Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Run the following command to check syntax of your updated config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nginx -t<\/pre>\n\n\n\n<p>If there are no errors, run the following command to restart NGINX server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo service nginx reload #debian\/ubuntu<br>$ systemctl restart nginx #redhat\/centos<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Verify_GZIP_Compression\"><\/span>4. Verify GZIP Compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you are wondering how to verify GZIP compression in NGINX, then there are many third-party tools like <a href=\"https:\/\/www.giftofspeed.com\/gzip-test\/\" target=\"_blank\" rel=\"noreferrer noopener\">GZIP compression test<\/a> where you can enter your website URL and it will tell you if GZIP compression is enabled on your website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"358\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/gzip-compression-tool.png?resize=730%2C358&#038;ssl=1\" alt=\"\" class=\"wp-image-1968\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/gzip-compression-tool.png?w=1339&amp;ssl=1 1339w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/gzip-compression-tool.png?resize=768%2C376&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n\n\n\n<p>Alternatively, you can also use command line tools like curl to check if GZIP compression is enabled or not. Here is the command to check your website&#8217;s home page for gzip compression.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ curl -H \"Accept-Encoding: gzip\" -I https:\/\/example.com<\/pre>\n\n\n\n<p>Here is the sample output. It should contain &#8216;Content-Encoding&#8217; header as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HTTP\/1.1 200 OK<br>...<br><strong>Content-Encoding: gzip<\/strong><\/pre>\n\n\n\n<p>Hopefully, the above article will help you enable and verify GZIP compression in NGINX. Similarly, you can also <a href=\"https:\/\/ubiq.co\/tech-blog\/enable-gzip-compression-apache\/\">enable GZIP compression in Apache web server<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to enable GZIP compression in NGINX server. Although it is disabled by default, it is highly recommended to enable it no matter what kind of website or application you are running. It reduces the size of response data on the fly, speeding up your website, improving performance and reducing network bandwidth costs. It is supported by almost all web browsers and NGINX servers.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/\">How to Enable Leverage Browser Caching<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-status-page\/\">How to Enable NGINX Status Page<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-cache-nginx-centos\/\">How to Install Varnish Cache for NGINX<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GZIP Compression reduces server load and improves server usage. Here&#8217;s how to enable NGINX Gzip compression for your server.<\/p>\n","protected":false},"author":1,"featured_media":1971,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[37],"class_list":["post-1959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-gzip-compression"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Enable NGINX Gzip Compression - Ubiq BI<\/title>\n<meta name=\"description\" content=\"GZIP Compression reduces server load and improves server usage. Here&#039;s how to enable NGINX Gzip compression for your server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable NGINX Gzip Compression - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"GZIP Compression reduces server load and improves server usage. Here&#039;s how to enable NGINX Gzip compression for your server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-27T05:57:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-31T06:35:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"655\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Enable NGINX Gzip Compression\",\"datePublished\":\"2020-10-27T05:57:06+00:00\",\"dateModified\":\"2025-10-31T06:35:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/\"},\"wordCount\":881,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1\",\"keywords\":[\"gzip compression\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/\",\"name\":\"How to Enable NGINX Gzip Compression - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1\",\"datePublished\":\"2020-10-27T05:57:06+00:00\",\"dateModified\":\"2025-10-31T06:35:09+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"GZIP Compression reduces server load and improves server usage. Here's how to enable NGINX Gzip compression for your server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1\",\"width\":1024,\"height\":655,\"caption\":\"how to enable gzip compression in nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-nginx-gzip-compression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable NGINX Gzip Compression\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable NGINX Gzip Compression - Ubiq BI","description":"GZIP Compression reduces server load and improves server usage. Here's how to enable NGINX Gzip compression for your server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable NGINX Gzip Compression - Ubiq BI","og_description":"GZIP Compression reduces server load and improves server usage. Here's how to enable NGINX Gzip compression for your server.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-10-27T05:57:06+00:00","article_modified_time":"2025-10-31T06:35:09+00:00","og_image":[{"width":1024,"height":655,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Enable NGINX Gzip Compression","datePublished":"2020-10-27T05:57:06+00:00","dateModified":"2025-10-31T06:35:09+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/"},"wordCount":881,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1","keywords":["gzip compression"],"articleSection":["Nginx"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/","name":"How to Enable NGINX Gzip Compression - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1","datePublished":"2020-10-27T05:57:06+00:00","dateModified":"2025-10-31T06:35:09+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"GZIP Compression reduces server load and improves server usage. Here's how to enable NGINX Gzip compression for your server.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1","width":1024,"height":655,"caption":"how to enable gzip compression in nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-gzip-compression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Enable NGINX Gzip Compression"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-enable-gzip-compression-nginx.jpeg?fit=1024%2C655&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-vB","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=1959"}],"version-history":[{"count":20,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1959\/revisions"}],"predecessor-version":[{"id":9841,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1959\/revisions\/9841"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1971"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}