After trying anything I could, the gzip compression in my nginx is still not working.
environment:
- Ubuntu 11.04 with nginx ppa, with the latest release (1.0.8)
- PHP5-FPM backend from package with proxy_pass.
main nginx config:
user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
server_names_hash_bucket_size 64;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
client_max_body_size 64M;
include /etc/nginx/mime.types;
default_type text/html;
types_hash_max_size 8192;
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;
## Compression
gzip on;
gzip_min_length 1000;
gzip_http_version 1.1;
gzip_comp_level 1;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/sites-enabled/*;
}
I remove gzip_disable, I read bugs about it with Ubuntu.
nginx compile config:
apt-get source nginx
auto/options contains:
HTTP_GZIP=YES
HTTP_GZIP_STATIC=NO
Please someone say something what do I miss.
I do not really understand, what happened, but somehow it came alive. I did not change anything, just rebooted the VPS. This is definately strange.
You need to reload or restart nginx.
If you didn't do this, then a restart of the OS would have achieved the same thing for you (though it was probably unnecessary).