I have an AWS EB environment of Python 3.7 running Amazon Linux 2/3.1.2 using Nginx as a proxy server. I'm trying to add a gzip compression for my application. I tried out several tutorials online but they all don't appear to work for me. I'm also new to AWS so might not be familiar with some of its services.
Currently, I had a directory tree like this:
-- .ebextensions
-- .platform
-- nginx
-- conf.d
-- gzip.conf
-- (other files)
I tried adding a config file in .ebextensions
to create a .conf
to enable gzip compression, but it didn't seem to work. I also tried switching the proxy to Apache, but no luck. This tutorial says that for the latest version of Amazon Linux 2, the nginx config files should be placed in the .platform
folder, so I did as noted. However, my gzip.conf
file still didn't seem to work - files are still rendered in their original formats.
Currently my gzip.conf:
gzip on;
gzip_vary on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/html text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
EDIT: I SSH'd into my eb instance and found this file is at /etc/nginx/conf.d/gzip.conf
and the content is the same as what I uploaded. Would this path be correct to enable gzip?
Any help will be appreciated!