{"id":13719885,"url":"https://github.com/evanmiller/mod_zip","last_synced_at":"2025-04-06T11:09:40.837Z","repository":{"id":697264,"uuid":"342254","full_name":"evanmiller/mod_zip","owner":"evanmiller","description":"Streaming ZIP archiver for nginx 📦","archived":false,"fork":false,"pushed_at":"2024-05-11T02:44:47.000Z","size":146,"stargazers_count":216,"open_issues_count":24,"forks_count":64,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-12T10:06:06.010Z","etag":null,"topics":["nginx","nginx-module","zip"],"latest_commit_sha":null,"homepage":"https://www.nginx.com/resources/wiki/modules/zip/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanmiller.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2009-10-19T13:39:37.000Z","updated_at":"2024-09-25T05:11:44.000Z","dependencies_parsed_at":"2024-05-11T03:41:38.934Z","dependency_job_id":null,"html_url":"https://github.com/evanmiller/mod_zip","commit_stats":{"total_commits":91,"total_committers":19,"mean_commits":"4.7894736842105265","dds":0.5604395604395604,"last_synced_commit":"8e65b82c82c7890f67a6107271c127e9881b6313"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmiller%2Fmod_zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmiller%2Fmod_zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmiller%2Fmod_zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmiller%2Fmod_zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanmiller","download_url":"https://codeload.github.com/evanmiller/mod_zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471521,"owners_count":20944158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","nginx-module","zip"],"created_at":"2024-08-03T01:00:57.316Z","updated_at":"2025-04-06T11:09:40.812Z","avatar_url":"https://github.com/evanmiller.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"mod_zip\n=======\n[![Build Status](https://travis-ci.org/evanmiller/mod_zip.svg?branch=master)](https://travis-ci.org/evanmiller/mod_zip)\n\nmod_zip assembles ZIP archives dynamically. It can stream component files from\nupstream servers with nginx's native proxying code, so that the process never\ntakes up more than a few KB of RAM at a time, even while assembling archives that\nare (potentially) gigabytes in size.\n\nmod_zip supports a number of \"modern\" ZIP features, including large files, UTC\ntimestamps, and UTF-8 filenames. It allows clients to resume large downloads using\nthe \"Range\" and \"If-Range\" headers, although these feature require the server\nto know the file checksums (CRC-32's) in advance. See \"Usage\" for details.\n\nTo unzip files on the fly, check out [nginx-unzip-module](https://github.com/youzee/nginx-unzip-module).\n\n\nInstallation\n------------\n\nTo install, compile nginx with the following option:\n\n    --add-module=/path/to/mod_zip\n\n* nginx 1.10.0 or later is required\n* (optional) to enable the `X-Archive-Charset` header, libiconv is required\n* http_postpone must be enabled by including at least one of the http_addition, http_slice or http_ssi modules\n\n\nUsage\n---\n\nThe module is activated when the original response (presumably from an\nupstream) includes the following HTTP header:\n\n    X-Archive-Files: zip\n\nIt then scans the response body for a list of files. The syntax is a \nspace-separated list of the file checksum (CRC-32), size (in bytes), location\n(properly URL-encoded), and file name. One file per line.  The file location\ncorresponds to a location in your nginx.conf; the file can be on disk, from an\nupstream, or from another module.  The file name can include a directory path,\nand is what will be extracted from the ZIP file. Example:\n\n    1034ab38 428    /foo.txt   My Document1.txt\n    83e8110b 100339 /bar.txt   My Other Document1.txt\n    0        0      @directory My empty directory\n\nFiles are retrieved and encoded in order. If a file cannot be found or the file\nrequest returns any sort of error, the download is aborted.\n\nThe CRC-32 is optional. Put \"-\" if you don't know the CRC-32; note that in this\ncase mod_zip will disable support for the `Range` header.\n\nA special URL marker `@directory` can be used to declare a directory entry\nwithin an archive. This is very convenient when you have to package a tree of\nfiles, including some empty directories. As they have to be declared explicitly.\n\nIf you want mod_zip to include some HTTP headers of the original request, in the\nsub-requests that fetch content of files, then pass the list of their names in\nthe following HTTP header:\n\n    X-Archive-Pass-Headers: \u003cheader-name\u003e[:\u003cheader-name\u003e]*\n\nRe-encoding filenames\n---\n\nTo re-encode the filenames as UTF-8, add the following header to the upstream\nresponse:\n\n    X-Archive-Charset: [original charset name]\n\nThe original charset name should be something that iconv understands. (This feature\nonly works if iconv is present.)\n\nIf you set original charset as `native`:\n\n    X-Archive-Charset: native;\n\nfilenames from the file list are treated as already in the system native charset.\nConsequently, the ZIP general purpose flag (bit 11) that indicates UTF-8 encoded\nnames will not be set, and archivers will know it's a native charset.\n\nSometimes there is problem converting UTF-8 names to native(CP866) charset that\ncauses popular archivers to fail to recognize them. And at the same time you want\ndata not to be lost so that smart archivers can use Unicode Path extra field.\nYou can provide you own, adapted representation of filename in native charset along\nwith original UTF-8 name in one string. You just need to add following header:\n\n    X-Archive-Name-Sep: [separator];\n\nSo your file list should look like:\n\n    \u003cCRC-32\u003e \u003csize\u003e \u003cpath\u003e \u003cnative-filename\u003e\u003cseparator\u003e\u003cutf8-filename\u003e\n    ...\n\nthen filename field will contatin `native-filename` and Unicode Path extra field\nwill contain `utf8-filename`.\n\nTips\n----\n\n1. Add a header \"Content-Disposition: attachment; filename=foobar.zip\" in the\nupstream response if you would like the client to name the file \"foobar.zip\"\n\n1. To save bandwidth, add a \"Last-Modified\" header in the upstream response; \nmod_zip will then honor the \"If-Range\" header from clients.\n\n1. To wipe the X-Archive-Files header from the response sent to the client,\nuse the headers_more module: http://wiki.nginx.org/NginxHttpHeadersMoreModule\n\n1. To improve performance, ensure the backends are not returning gzipped\nfiles. You can achieve this with `proxy_set_header Accept-Encoding \"\";`\nin the location blocks for the component files.\n\nQuestions/patches may be directed to Evan Miller, emmiller@gmail.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanmiller%2Fmod_zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanmiller%2Fmod_zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanmiller%2Fmod_zip/lists"}