Welcome! Log In Create A New Profile


Gzipping xhtml pages

Dave Kennard
November 27, 2009 08:32AM
I'm having trouble in getting Nginx to gzip my pages that are served as

In my nginx.conf http block I have the following:
/ gzip on;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript
text/xml application/xml application/xhtml+xml application/xml+rss

/In mime.types I commented out the existing xhtml entry and added
/ application/xhtml+xml xhtml;/
So a plain text file with .xhtml extension is served with content-type
application/xhtml+xml, but it is not being gzipped for some reason? CSS
and javascript are being gzipped okay though.

The response headers for my test xhtml page look like this:
/HTTP/1.1 200 OK
Server: nginx
Date: Fri, 27 Nov 2009 13:23:33 GMT
Content-Type: application/xhtml+xml
Connection: keep-alive
Content-Length: 11
Last-Modified: Fri, 27 Nov 2009 13:13:42 GMT
Accept-Ranges: bytes/

Can anyone help me get my pages gzipped with content type header of


nginx mailing list
Subject Author Posted

Gzipping xhtml pages

Dave Kennard November 27, 2009 08:32AM

Re: Gzipping xhtml pages

Igor Sysoev November 27, 2009 08:38AM

Re: Gzipping xhtml pages

Dave Kennard November 28, 2009 07:08AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready