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