nginx not gzipping php output

djeyewater nginx-forum at nginx.us
Tue Sep 6 13:12:32 UTC 2011


Nginx isn't gzipping php pages, but I don't know why? I'm using the
Audits tab in Google Chrome Developer tools to determine that the pages
aren't being gzipped.

My config:
nginx version: nginx/0.8.52
built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 
configure arguments: --prefix=/home/djeyewater/apps/nginx
--with-pcre=/home/djeyewater/tarballs/pcre-8.10
--without-http_autoindex_module --without-http_charset_module
--without-http_empty_gif_module --without-http_geo_module
--without-http_ssi_module --with-http_gzip_static_module
--with-http_realip_module --with-http_geoip_module --with-cc-opt='-I
/home/djeyewater/apps/GeoIP/include'
--with-ld-opt='-Wl,-R,/home/djeyewater/apps/GeoIP/lib -L
/home/djeyewater/apps/GeoIP/lib'


And http section from the .conf file:
http {
	include       mime.types;
	default_type  application/octet-stream;

	server_names_hash_bucket_size 128;

	sendfile        on;
	keepalive_timeout  10 10;
	
	port_in_redirect off;
	
	#Fix IP address
	set_real_ip_from   127.0.0.1;
	real_ip_header     X-Forwarded-For;

	gzip  on;
	gzip_comp_level 3;
	gzip_proxied any;
	gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xhtml+xml application/xml+rss
text/javascript;
	gzip_disable "MSIE [1-6]\.";
	
	geoip_country /home/djeyewater/apps/GeoIP/share/GeoIP/GeoIP.dat;
	
	log_format main '$remote_addr - $remote_user [$time_local] '
	             '"$request" $status $body_bytes_sent "$http_referer" '
	             '"$http_user_agent"';

	include sites/*;
}

Thanks

Dave

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214879,214879#msg-214879



More information about the nginx mailing list