nginx does't serve compressed static .html files. is it a bug?

Francis Daly francis at daoine.org
Thu Feb 5 21:14:44 UTC 2015


On Thu, Feb 05, 2015 at 10:28:33PM +0200, peter petrov wrote:

Hi there,

>  Francis Daly I did what you suggested but it doesn't work. Access.log says both times with --compressed or without it "200 162" for the nginx welcome screen.It is very weird.

It works for me:

# ls -l html/index.html*
-rw-r--r-- 1 root root 612 Jul 23  2013 html/index.html
-rw-r--r-- 1 root root 392 Feb  5 21:06 html/index.html.gz

# cat conf/nginx.conf
events {}
http {
  gzip_static on;
  server {
    listen 8080;
  }
}

# curl -i  http://localhost:8080/
[http 200, I see the content]

# curl -i --compressed http://localhost:8080/
[http 200, I see the content]

# tail -n 2 logs/access.log
127.0.0.1 - - [05/Feb/2015:21:08:51 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5"
127.0.0.1 - - [05/Feb/2015:21:08:57 +0000] "GET / HTTP/1.1" 200 392 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5"


Repeat the test with exactly this configuration to see if it fails for you.

Or show exactly what you are doing so someone can see if it work for them.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list