lnmpa中gzip 压缩问题
apahce的 rewrite是这样的:Options +FollowSymLinksRewriteEngine on
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteRule (.*)Release(.*)\.js $1Compressed$2\.jsgz
RewriteRule (.*)Release(.*)\.data $1Compressed$2\.datagz
RewriteRule (.*)Release(.*)\.mem $1Compressed$2\.memgz
RewriteRule (.*)Release(.*)\.unity3d $1Compressed$2\.unity3dgz
AddEncoding gzip .jsgz
AddEncoding gzip .datagz
AddEncoding gzip .memgz
AddEncoding gzip .unity3dgz
但在nginx 下是不起作用的 如何让apahce来执行这个rewrite 或者请大家帮把这个rewrite的转换为 nginx的 rewrite /(.*)Release(.*).js /$1Compressed$2.jsgz last;
rewrite /(.*)Release(.*).data /$1Compressed$2.datagz last;
rewrite /(.*)Release(.*).mem /$1Compressed$2.memgz last;
rewrite /(.*)Release(.*).unity3d /$1Compressed$2.unity3dgz last;
你可以curl -IL 你的文件看看的Content-Type是什么类型的加到nginx.conf 的gzip_type里试试看
你用的什么程序,官网应该都有提高吧 gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss application/octet-stream;
application/octet-stream 这个类型的 这个unity3d 的webgl 官网只有针对apache的 没有nginx的
页:
[1]