Page 1 of 1

How to enable gzip?

Posted: Sun Apr 19, 2015 6:27 pm
by kudouyuzi
How to enable gzip?
I need runing MyBB.

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:07 pm
by skurudo
kudouyuzi wrote:How to enable gzip?
I need runing MyBB.
Why do you think, gzip disabled?

/etc/nginx/nginx.conf

Code: Select all

   # Compression
    gzip                on;
    gzip_comp_level     9;
    gzip_min_length     512;
    gzip_disable        "msie6";
    gzip_buffers        8 64k;
    gzip_types          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;
    gzip_vary           on;
    gzip_proxied        any;

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:38 pm
by kudouyuzi
skurudo wrote:
kudouyuzi wrote:How to enable gzip?
I need runing MyBB.
Why do you think, gzip disabled?

/etc/nginx/nginx.conf

Code: Select all

   # Compression
    gzip                on;
    gzip_comp_level     9;
    gzip_min_length     512;
    gzip_disable        "msie6";
    gzip_buffers        8 64k;
    gzip_types          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;
    gzip_vary           on;
    gzip_proxied        any;
but apache dont open gzip

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:40 pm
by skurudo
kudouyuzi wrote:but apache dont open gzip
What error exactly do you get? When did you get this error?

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:42 pm
by kudouyuzi
skurudo wrote:
kudouyuzi wrote:but apache dont open gzip
What error exatly do you get? When did you get this error?
cant display posts

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:45 pm
by skurudo
kudouyuzi wrote:cant display posts
Can you quote less? ;)

If you want apache gzip so badly, check enabled or not mod_deflate from console:

Code: Select all

a2enmod deflate
If module enabled, you get this:

Code: Select all

Module deflate already enabled
And you can use code like this in your .htaccess file:

Code: Select all

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:48 pm
by skurudo
It's general steps, with no more information from you, hard to say what's going on on your server.
And, you know, PSI Corps forbid use telepathy over internet ;-)

Re: How to enable gzip?

Posted: Sun Apr 19, 2015 8:56 pm
by kudouyuzi
skurudo wrote:It's general steps, with no more information from you, hard to say what's going on on your server.
And, you know, PSI Corps forbid use telepathy over internet ;-)
THX

Re: How to enable gzip?

Posted: Fri Aug 28, 2015 6:57 am
by pandabb
fresh install vesta cp for centos only have this file types for gzip.

gzip_types text/plain text/css text/javascript
application/x-javascript;