0
我已經設置gzip來關閉爲什麼nginx的總是發送內容編碼以gzip格式
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip off;
include /etc/nginx/conf.d/*.conf;
}
服務器配置
服務器{ 聽80 default_server;
root /home/www;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
proxy_buffering off;
location /frontend {
location ~* \.php$ {
try_files /dev/null @directphp;
}
}
location/{
include fastcgi_params;
fastcgi_pass x.x.x.x:9000;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
location @directphp {
include fastcgi_params;
fastcgi_pass x.x.x.x:9000;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}
檢查沒有設置其他地方
cd /etc/nginx/
grep -R gzip .
./nginx.conf: gzip off;
service nginx restart
但內容仍然getiing發送以gzip格式?
響應頭
Connection:keep-alive
Content-Encoding:gzip
Content-Length:51
Content-Type:application/json; charset=utf-8
Date:Wed, 05 Oct 2016 10:00:00 GMT
Server:nginx/1.6.2
Vary:Accept-Encoding
任何想法把gzip的完全關閉
顯示服務器配置 –