Konfigurasi GZIP di Nginx

 
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
View Mode
Views:

907


Replies:0

Konfigurasi GZIP di Nginx

Konfigurasi GZIP di Nginx

Apa itu GZIP google-lieng doloe faman Ketawa

Pertama buka:

/etc/nginx/nginx.conf

Tambahkan beberapa baris berikut ini:

gzip  on;
    gzip_min_length  1000;
    gzip_disable "msie6";

    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

Ke dalam deklarasi http

Misalnya:

http {
    # konfigurasi paman lainnya

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    # konfigurasi GZIP paman

    gzip  on;
    gzip_min_length  1000;
    gzip_disable "msie6";

    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    include /etc/nginx/conf.d/*.conf;
}

Jangan lupa kalau sudah restart atau reload nginx nya Hehe

service nginx restart
Atau
service nginx reload
(This post was last modified: 05-04-2014 07:20 PM by SunDi3yansyah.)
kampoeng