Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Web Servers»Nginx»How to Enable Gzip Compression on Nginx Web Server

    How to Enable Gzip Compression on Nginx Web Server

    RahulBy RahulJanuary 28, 20151 Min Read

    Gzip compression are used for transferring data in compressed format to end users. This reduced website page load time and increases performance. If you are not sure that your site is running with gzip compression or not on Nginx server, Then you can use online gzip compression sites (Given at end of post) to confirm. If it’s already enabled with gzip you don’t need to do anything. But if gzip is not enabled, follow below steps.

  • Read: How to enable Gzip Compression on Apache Server
  • Enable Gzip in Nginx

    To enable gzip compression in Nginx server, Add the following content in Nginx main configuration file or create a separate gzip configuration file with following content.

    # vim /etc/nginx/conf.d/gzip.conf
    
    gzip on;
    gzip_min_length  100;
    gzip_buffers  8 32k;
    gzip_types  text/plain text/css application/x-javascript text/xml application/xml text/javascript;
    gzip_vary on;
    

    After adding above configuration just restart Nginx web server.

    # systemctl restart nginx
    

    Verify Gzip

    Now as your site has been enabled with gzip compression, let’s use one of below online tools to verify gzip is working correctly.

  • http://checkgzipcompression.com/
  • http://www.whatsmyip.org/http-compression-test/
  • Gzip Compression on Nginx

    compression gzip nginx
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow do I Install and Use Iptables on CentOS/RHEL 7
    Next Article How to Increase Max Open File Limit in Linux System

    Related Posts

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How to Increase Request Timeout in NGINX

    Updated:January 13, 20222 Mins Read

    How To Enable Brotli Compression in Apache

    2 Mins Read

    How to Install Nginx, MySQL & PHP (LEMP) on Ubuntu 20.04

    5 Mins Read

    How To Install Nginx with PHP-FPM on Ubuntu 20.04

    Updated:December 3, 20203 Mins Read

    How to Install Nginx on Ubuntu 20.04

    3 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.