Skip to content
This repository
Newer
Older
100644 69 lines (45 sloc) 2.472 kb
72f60ce1 » Evan Miller
2009-10-19 First commit.
1 mod_zip
2f3e6b03 »
2010-12-31 Update README
2 =======
72f60ce1 » Evan Miller
2009-10-19 First commit.
3
4 mod_zip assembles ZIP archives dynamically. It can stream component files from
5 upstream servers with nginx's native proxying code, so that the process never
6 takes up more than a few KB of RAM at a time, even while assembling archives that
7 are (potentially) hundreds of megabytes.
8
2f3e6b03 »
2010-12-31 Update README
9
10 Installation
11 ------------
12
72f60ce1 » Evan Miller
2009-10-19 First commit.
13 To install, compile nginx with the following option:
14
03d59749 »
2010-12-31 README fixes
15 --add-module=/path/to/this/directory
72f60ce1 » Evan Miller
2009-10-19 First commit.
16
2f3e6b03 »
2010-12-31 Update README
17 nginx 0.7.25 or later is required. If libiconv is present, support for the
18 "X-Archive-Charset" header is enabled; see below.
19
20
21 Usage
22 -----
72f60ce1 » Evan Miller
2009-10-19 First commit.
23
24 The module is activated when the original response (presumably from an
25 upstream) includes the following HTTP header:
26
03d59749 »
2010-12-31 README fixes
27 X-Archive-Files: zip
72f60ce1 » Evan Miller
2009-10-19 First commit.
28
29 It then scans the response body for a list of files. The syntax is a
30 space-separated list of the file checksum (CRC-32), size (in bytes), location
31 (properly URL-encoded), and file name. One file per line. The file location
32 corresponds to a location in your nginx.conf; the file can be on disk, from an
33 upstream, or from another module. The file name can include a directory path,
34 and is what will be extracted from the ZIP file. Example:
35
e646efab »
2010-12-31 README fixes
36 1034ab38 428 /foo.txt My Document1.txt
37 83e8110b 100339 /bar.txt My Other Document1.txt
72f60ce1 » Evan Miller
2009-10-19 First commit.
38
39 Files are retrieved and encoded in order. If a file cannot be found or the file
40 request returns any sort of error, the download is aborted.
41
42 The CRC-32 is optional. Put "-" if you don't know the CRC-32; note that in this
911b447c » Evan Miller
2010-01-26 Update from Google Code SVN
43 case mod_zip will disable support for the "Range" header.
72f60ce1 » Evan Miller
2009-10-19 First commit.
44
2f3e6b03 »
2010-12-31 Update README
45 To re-encode the filenames as UTF-8, add the following header to the upstream
46 response:
47
03d59749 »
2010-12-31 README fixes
48 X-Archive-Charset: [original charset name]
2f3e6b03 »
2010-12-31 Update README
49
50 The original charset name should be something that iconv understands. (This feature
51 only works if iconv is present.)
52
53
54 Tips
55 ----
56
911b447c » Evan Miller
2010-01-26 Update from Google Code SVN
57 Tip: Add a header "Content-Disposition: attachment; filename=foobar.zip" in the
72f60ce1 » Evan Miller
2009-10-19 First commit.
58 upstream response if you would like the client to name the file "foobar.zip"
59
911b447c » Evan Miller
2010-01-26 Update from Google Code SVN
60 Tip 2: To save bandwidth, add a "Last-Modified" header in the upstream response;
61 mod_zip will then honor the "If-Range" header from clients.
62
2657fc82 »
2010-12-31 proxy_hide_header tip.
63 Tip 3: To wipe the X-Archive-Files header from the response sent to the client,
f8ba5038 » Evan Miller
2011-11-13 Fix gcc warnings
64 use the headers_more module: http://wiki.nginx.org/NginxHttpHeadersMoreModule
2657fc82 »
2010-12-31 proxy_hide_header tip.
65
b5d33623 » Evan Miller
2012-03-17 Update README with SSL tip
66 Tip 4: Using mod_zip with SSL will not work if the backend response has
67 a Set-Cookie header. Wipe it with the headers_more module (see tip 3).
68
72f60ce1 » Evan Miller
2009-10-19 First commit.
69 Questions/patches may be directed to Evan Miller, emmiller@gmail.com.
Something went wrong with that request. Please try again.