172 Views
1. Go to terminal and login via ssh root/user.
![How to configure gzip compression with NGINX?](https://www.infinitivehost.com/knowledge-base/wp-content/uploads/2023/08/image2-7.png)
2. Go to Nginx configuration file.
![How to configure gzip compression with NGINX?](https://www.infinitivehost.com/knowledge-base/wp-content/uploads/2023/08/image1-6.png)
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
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
![Gzip Settings](https://www.infinitivehost.com/knowledge-base/wp-content/uploads/2023/08/image5-3-1024x134.png)
wq!
Save file and quite.
3. Run the below command to check syntax of your update config file.
![Run the below command to check syntax of your update config file](https://www.infinitivehost.com/knowledge-base/wp-content/uploads/2023/08/image4-6.png)
4. Now restart the service of Nginx.
![Now restart the service of Nginx](https://www.infinitivehost.com/knowledge-base/wp-content/uploads/2023/08/image3-5.png)