Проект NUXT SSR при сборке создаёт сжатые gzip и brotli файлы, но в Chrome DevTools показывается, что передаются не сжатые файлы.
// nuxt.config.js
...
modules: [
[
"nuxt-compress",
{
gzip: {
cache: true
},
brotli: {
threshold: 10240
}
}
]
]
...
NGINX как прокси сервер скомпилирован с http_gzip_static_module и ngx_brotli
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
server_name mysite.com ;
charset UTF-8;
gzip on;
gzip_proxied any;
gzip_types text/plain text/xml application/xml application/x-javascript text/javascript text/css text/json application/javascript;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
gzip_comp_level 8;
gzip_disable "msie6";
gzip_http_version 1.1;
brotli on;
brotli_comp_level 6;
brotli_static on;
brotli_types text/xml image/svg+xml application/x-font-ttf image/vnd.microsoft.icon application/x-font-opentype application/json font/eot application/vnd.ms-fontobject application/javascript font/otf application/xml appl$
location / {
expires $expires;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://localhost:3001;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name *.mysite.com;
return 301 https://mysite.com$request_uri;
listen 80;
return 404; # managed by Certbot
}
server {
if ($host = mysite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name mysite.com;
listen 80;
return 404; # managed by Certbot
}