通过Nginx访问的静态文件下载到浏览器客户端超过10秒,这时候要注意是否进行了gzip压缩,看响应头response header
具体设置如下:
server { listen 80; server_name abc.baidu.com; root /etc/nginx/html/h5; index index.html; gzip on; gzip_buffers 32 4K; gzip_comp_level 6; gzip_min_length 100; gzip_types application/javascript text/css text/xml; gzip_disable "MSIE [1-6]\."; location ~ ^/MP_verify.*\.txt$ { root /data/h5/; index index.html; } location / { try_files $uri $uri/ @router; index index.html; } location @router { rewrite ^.*$ /index.html last; } }