gzip shows as not enabled on my vps site and not even the tech support of my host, asmallorange, can figure out the cause of my problem. I've documented my exact set-up (nothing more than this was done):
- I installed centos 7 minimal
- I logged in via putty
Then i input the following commands
yum update
yum clean all
yum install epel-release
yum install nginx
systemctl enable nginx
vi /etc/nginx/nginx.conf
user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; events { worker_connections 1024; } http { 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; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; include /etc/nginx/mime.types; default_type application/octet-stream; limit_conn_zone $binary_remote_addr zone=addr:8m; limit_req_zone $binary_remote_addr zone=mylimit:16m rate=16r/s; server { listen 80 default_server; listen [::]:80 default_server; server_name abcj.me; root /srv; index index-l1.html gzip on; gzip_vary on; gzip_min_length 1024; gzip_types text/css text/plain; client_body_timeout 8; client_header_timeout 8; location ~* \.(css|ico|jpeg|jpg|js|mp3|mp4|pdf|png|txt|webp|zip)$ { expires 16d; } location ~* \.(html)$ { expires 1d; } error_page 404 /404-l1.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } server { listen 80; server_name www.abcj.me; return 301 http://abcj.me$request_uri; } }
service nginx restart
- I uploaded
index-l1.html
tosrv
viawinscp
nginx -V 2>&1 | tr -- - '\n' | grep module
shows that i have
http_gzip_static_module
http_gunzip_module
curl -H "Accept-Encoding: gzip" -I http://example.me/index-l1.html
does not show gzip acceptance.
https://www.example.com/gzip-test/
does not show gzip acceptance