nginx gzip


worker_processes  10;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

events {
    worker_connections  1024;
}

# http conf
http {
    #include     http/common.conf;
    #include     http/cache.conf;
    #include     http/resty.conf;
    #include     http/mime.types;

    include     http/*.conf;

    include     http/servers/*.conf;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" "$request_filename"';
  
    access_log  logs/access.log  main;  


        #charset koi8-r;

        #access_log  logs/host.access.log  main;
server{
        listen       8090;
        server_name  localhost;
        #ssl on;
        #从腾讯云获取到的第一个文件的全路径
        #ssl_certificate /etc/ssl/server.pem;
        #ssl_certificate_key /etc/ssl/server.key;
       location /backoffice  {
            gzip on; 
            root /var/www/html;
            index  index.html index.htm;
           if ($request_filename ~  .*.(js|css|htm|html)$)
                 {
                   expires      -1;
                 }
        }
}

}

原文地址:https://www.cnblogs.com/hzcya1995/p/13348316.html