3 messages in ru.sysoev.nginxRe: Sending pre-compressed data via n...
FromSent OnAttachments
Yusuf GoolamabbasAug 30, 2006 4:05 pm 
Igor SysoevAug 30, 2006 10:10 pm 
Igor SysoevAug 31, 2006 2:16 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Sending pre-compressed data via nginxActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Aug 31, 2006 2:16:43 am
List:ru.sysoev.nginx

On Thu, 31 Aug 2006, Igor Sysoev wrote:

On Thu, 31 Aug 2006, Yusuf Goolamabbas wrote:

Hi, I wasn't able to figure out if it's possible to send out precompressed (gzipped data) via nginx It just needs to add Content-Encoding: gzip to the response header

I'm looking for something similar to what can be done in lighttpd

http://trac.lighttpd.net/trac/wiki/Docs%3AModSetEnv

Currently it's easy to do only if you can easy separate locations:

location / { root /path/to/files; }

location ~* "(README|ChangeLog|\.txt)\.gz$" { root /path/to/files;

add_header Content-Encoding gzip;

# turn off on the fly gzip compression, because # it does not currently check header set by "add_header" gzip off;

# nginx set type according last suffix only type { text/plain gz } }

It could be also done is such way:

location / { root /path/to/files;

### location ~* "(README|ChangeLog|\.txt)\.gz$" { add_header Content-Encoding gzip; gzip off; type { text/plain gz; } }

location ~* "\.html\.gz$" { add_header Content-Encoding gzip; gzip off; type { text/html gz; } } ###

The text between ### could be include'd from file and used in several locations.