iiko 发表于 2013-4-28 13:04:02

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

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

[ 本帖最后由 iiko 于 2013-4-29 21:14 编辑 ]

licess 发表于 2013-4-28 14:55:58

虚拟主机 server 段里加上gzip off;
重启

iiko 发表于 2013-4-29 21:06:27

回复 2# 的帖子

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

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

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

[ 本帖最后由 iiko 于 2013-4-29 21:39 编辑 ]

licess 发表于 2013-4-30 10:00:55

加到哪个地方了,发一下配置文件

iiko 发表于 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_passunix:/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 编辑 ]
页: [1]
查看完整版本: 请问如何关闭指定网站的Gzip压缩功能呢?