美文网首页
nginx配置 打开gizp

nginx配置 打开gizp

作者: 失控疯男 | 来源:发表于2018-03-13 22:15 被阅读0次

    修改nginx.conf文件

    #   * Official Russian Documentation: http://nginx.org/ru/docs/
    
    user nginx;
    worker_processes auto;
    error_log /var/log/nginx/error.log;
    pid /var/run/nginx.pid;
    
    # Load dynamic modules. See /usr/share/nginx/README.dynamic.
    include /usr/share/nginx/modules/*.conf;
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    # Load dynamic modules. See /usr/share/nginx/README.dynamic.
    include /usr/share/nginx/modules/*.conf;
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        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;
    
        #添加下面的这几句
        gzip on;
        gzip_disable "MSIE [1-6]\.(?!.*SV1)";
        gzip_proxied any;
        gzip_buffers 16 8k;
        gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
        gzip_vary on;
    
        sendfile            on;
        tcp_nopush          on;
        tcp_nodelay         on;
        keepalive_timeout   65;
    

    相关文章

      网友评论

          本文标题:nginx配置 打开gizp

          本文链接:https://www.haomeiwen.com/subject/oiotqftx.html