I'm facing an issue with AWS Elastic Beanstalk(Php,Symfony) and gzip.
I'm trying to enable Gzip compression but it work only for .svg files with this configuration :
nginx.config
server {
gzip on;
gzip_static on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
gzip_min_length 1400;
}
symfony.config
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
gzip_min_length 1400;
if ($host !~* ^www\.) {
return 301 https://www.$host$request_uri;
}
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
}
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
gzip_static on;
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
}
Is there any way to fix it ?