Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Web Servers»Nginx»How to Enable Gzip Compression on Nginx Web Server

    How to Enable Gzip Compression on Nginx Web Server

    By 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.

    Advertisement
  • 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

    Related Posts

    Configuring Nginx for Laravel on Ubuntu & Debian

    Configuring Nginx to Handle 100 Thousands Request Per Minute

    Configuring Nginx to Handle 100 Thousands Request Per Minute

    How To Set Up Nginx Reverse Proxy: A Step-By-Step Tutorial

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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