Enable gzip compression on Elastic Beanstalk with nginx

Create nginx_gzip_configuration.config file into .ebextensions directory and then put the following script.

files:
  "/etc/nginx/conf.d/gzip.conf":
      mode: "644"
      owner: "root"
      group: "root"
      content: |
        # enable gzip compression
        gzip on;
        gzip_min_length  1100;
        gzip_buffers  4 32k;
        gzip_types    text/plain text/html text/xml text/css application/javascript application/json;
        gzip_vary on;
        # end gzip configuration

container_commands:
  02_restart_nginx:
    command: service nginx restart

Comments

  1. Hi Arvind
    thanks for our article, but this doesn't work for me.!
    My stack with AWS_Elasticbeanstalk+Tomcat+Github+Springboot

    ReplyDelete

Post a Comment

Popular Posts

How to pass hash in Postman

nginx: unrecognized service

Reading Excel Sheets using "Roo" gem in ruby on rails

Bootstrap Select Picker append add new item if search not exist

Add CORS to Nginx on AWS Elastic Beanstalk

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Get video duration by URL in Ruby on Rails

site-enables nginx setting in ruby in rails