https://github.com/ajax16384/ngx_http_untar_module
Nginx HTTP Untar Module
https://github.com/ajax16384/ngx_http_untar_module
Last synced: 6 months ago
JSON representation
Nginx HTTP Untar Module
- Host: GitHub
- URL: https://github.com/ajax16384/ngx_http_untar_module
- Owner: ajax16384
- License: mit
- Created: 2019-03-02T12:30:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2026-02-05T07:03:02.000Z (6 months ago)
- Last Synced: 2026-02-05T19:27:34.608Z (6 months ago)
- Language: C
- Size: 17.6 KB
- Stars: 12
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nginx - ngx_http_untar_module - Serves file content directly out of tar archives. 📦 (Streaming, media and image processing)
README
# Nginx HTTP Untar module
This [nginx](https://nginx.org/) module can serve static file content directly from tar archives.
Inspired by [nginx-unzip-module](https://github.com/youzee/nginx-unzip-module).
## Pre-built Packages (Ubuntu / Debian)
Pre-built packages for this module are freely available from the GetPageSpeed repository.
> **Note:** GetPageSpeed is a third-party repository and is not affiliated with the author of this module.
```bash
# Install the repository keyring
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://extras.getpagespeed.com/deb-archive-keyring.gpg \
| sudo tee /etc/apt/keyrings/getpagespeed.gpg >/dev/null
# Add the repository (Ubuntu example - replace 'ubuntu' and 'jammy' for your distro)
echo "deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/ubuntu jammy main" \
| sudo tee /etc/apt/sources.list.d/getpagespeed-extras.list
# Install nginx and the module
sudo apt-get update
sudo apt-get install nginx nginx-module-untar
```
The module is automatically enabled after installation. Supported distributions include Debian 12/13 and Ubuntu 20.04/22.04/24.04 (both amd64 and arm64). See [the complete setup instructions](https://apt-nginx-extras.getpagespeed.com/apt-setup/).
## Features
* Zero-copy: outputs content directly from archive file (no temporary files)
* Caching parsed archive file entries: reduce archive scan-search time
* Supported tar item types: normal file, long file name data
## Configuration example
```nginx
location ~ ^/(.+?\.tar)/(.*)$ {
untar_archive "$document_root/$1";
untar_file "$2";
untar;
}
```
## Module directives
***
**untar_archive** `string`
**context:** `http, server, location`
Specifies tar archive name.
***
**untar_file** `string`
**context:** `http, server, location`
Specifies file to be extracted from **untar_archive**.
***
**untar**
**context:** `location`
Invokes untar of **untar_file** from **untar_archive**
***
## Known limitations
* only GET,HEAD verbs supported
* no archive entries listing
* base tar format support (only normal files: no symlink, sparse e.t.c)
## TODO
* Limit cache archive descriptors, free expired archive descriptors
* GNU extension modification time format