Skip to content

untar: NGINX HTTP Untar Module

Debian/Ubuntu installation

These docs apply to the APT package nginx-module-untar provided by the GetPageSpeed Extras repository.

  1. Configure the APT repository as described in APT repository setup.
  2. Install the module:
sudo apt-get update
sudo apt-get install nginx-module-untar
Show suites and architectures
| Distro   | Suite             | Component   | Architectures   |
|----------|-------------------|-------------|-----------------|
| debian   | bookworm          | main        | amd64, arm64    |
| debian   | bookworm-mainline | main        | amd64, arm64    |
| debian   | trixie            | main        | amd64, arm64    |
| debian   | trixie-mainline   | main        | amd64, arm64    |
| ubuntu   | focal             | main        | amd64, arm64    |
| ubuntu   | focal-mainline    | main        | amd64, arm64    |
| ubuntu   | jammy             | main        | amd64, arm64    |
| ubuntu   | jammy-mainline    | main        | amd64, arm64    |
| ubuntu   | noble             | main        | amd64, arm64    |
| ubuntu   | noble-mainline    | main        | amd64, arm64    |

This nginx module can serve static file content directly from tar archives. Inspired by nginx-unzip-module.

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

  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)