VPS侦探论坛

 找回密码
 注册
查看: 5580|回复: 4

请问如何关闭指定网站的Gzip压缩功能呢?

[复制链接]
发表于 2013-4-28 13:04:02 | 显示全部楼层 |阅读模式

我现在Lnmp默认是启用Gzip压缩功能的.
VPS上有4个网站,.我想把一个网站的Gzip功能关闭,请问怎么设置呢?

[ 本帖最后由 iiko 于 2013-4-29 21:14 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-4-28 14:55:58 | 显示全部楼层


虚拟主机 server 段里加上gzip off;
重启
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-4-29 21:06:27 | 显示全部楼层

回复 2# 的帖子


我在 /usr/local/nginx/conf/vhost/域名.conf 的server 段里加上gzip off;

然后执行这个命令重启/usr/local/nginx/sbin/nginx -s reload

后提示以下代码,,(导致全部网站无法打开). 军哥请问我哪里弄错了吗?
[root@benben ~]# /usr/local/nginx/sbin/nginx -s reload
nginx: [emerg] "gzip" directive is duplicate in /usr/local/nginx/conf/vhost/www.955n.com.conf:31
[root@benben ~]#

[ 本帖最后由 iiko 于 2013-4-29 21:39 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-4-30 10:00:55 | 显示全部楼层



加到哪个地方了,发一下配置文件
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-5-1 00:45:33 | 显示全部楼层

回复 4# 的帖子


server
        {
                listen       80;
                server_name www.xxx.com xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/qqq/xxx;

                include none.conf;
                location ~ .*\.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log off;
                gzip off;
        }
error_page 404 /404.html;


____________________________________
搞定了,要把gzip off;放在{ }内才可以.谢谢军哥

[ 本帖最后由 iiko 于 2013-5-1 01:31 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-24 13:25 , Processed in 0.026055 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表