Page 1 of 1

ngnix gzip

Posted: Sat May 10, 2014 7:36 am
by muzhik
хотел включить для сайта пользователя gzip

прописал новую директиву http и gzip-параметры.
при перезапуске nginx выдает что там эта директива запрещена. Куда ее прописать чтобы включить для отдельного сайта/юзера куда прописать если я хочу включить на все сайты?

предлагаю настройки сжатия вынести в настройки домена.

Re: ngnix gzip

Posted: Sat May 10, 2014 8:23 am
by imperio
По умолчанию gzip сжатие в главном конфиге nginx /etc/nginx/nginx.conf - включено

Code: Select all

# Compression
    gzip                on;
    gzip_comp_level     9;
    gzip_min_length     512;
    gzip_buffers        8 64k;
    gzip_types          text/plain text/css text/javascript
                        application/x-javascript;
    gzip_proxied        any;

Re: ngnix gzip

Posted: Thu Oct 09, 2014 7:59 am
by Abraham777
http://developers.google.com/speed/pagespeed/ не видит включенный gzip. С чем это может быть связанно?

Re: ngnix gzip

Posted: Thu Jan 22, 2015 5:56 pm
by rigs
Replace current the gzip_types (In nginx.conf) with this:

Code: Select all

text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/x-font-ttf font/opentype;
and then restart nginx and run PageSpeed again. It works for me.

In case you're using Wordpress and notice note odd characters in your website, try to turn off the compression feature in cache plugin, such as w3 total cache, hypercache, etc.

Re: ngnix gzip

Posted: Thu Apr 09, 2015 3:56 pm
by AmiGator
rigs wrote:Replace current the gzip_types (In nginx.conf) with this:

Code: Select all

text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/x-font-ttf font/opentype;
Это действительно работает!
Хорошо бы разработчикам это как то внедрить :-)

Re: ngnix gzip

Posted: Thu Apr 09, 2015 4:16 pm
by imperio
AmiGator wrote:
rigs wrote:Replace current the gzip_types (In nginx.conf) with this:

Code: Select all

text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/x-font-ttf font/opentype;
Это действительно работает!
Хорошо бы разработчикам это как то внедрить :-)
https://bugs.vestacp.com/

Re: ngnix gzip

Posted: Tue Jan 12, 2016 6:44 pm
by bodzilla
Спасибо, работает!
Можете добавить в следующий релиз.