Iam a new Linux system admin and how can I enable gzip compression on nginx web server for JS/CSS/HTML files? How can I enable gzip/deflate in Nginx on Ubuntu Linux server? How do I configure gzip compression with NGINX web server on FreeBSD Unix server?
You need to use the ngx_http_gzip_module module. It compresses all valid HTTP responses (files) using the “gzip” method. This is useful to reduce data transfer size and speed up web pages for static assets such as JavaScript, CSS files and more. This page explains how to enable the gzip/deflate in nginx running on Linux or Unix-like systems.
ADVERTISEMENTS
Edit your nginx.conf file or create a new config file called /etc/nginx/conf.d/static_gzip.conf:
$ sudo vi /etc/nginx/nginx.conf
#nginx #linux #unix