All Projects → tokers → Zstd Nginx Module

tokers / Zstd Nginx Module

Licence: bsd-2-clause
Nginx modules for the Zstandard compression

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Zstd Nginx Module

Ngx healthcheck module
nginx module for upstream servers health check. support stream and http upstream. 该模块可以为Nginx提供主动式后端服务器健康检查的功能(同时支持四层和七层后端服务器的健康检测)
Stars: ✭ 145 (+126.56%)
Mutual labels:  nginx, nginx-module
Ngx php
ngx_php - Embedded php scripting language for nginx module. All released versions of the code repository.
Stars: ✭ 290 (+353.13%)
Mutual labels:  nginx, nginx-module
Mod zip
Streaming ZIP archiver for nginx 📦
Stars: ✭ 178 (+178.13%)
Mutual labels:  nginx, nginx-module
Nginx Builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 123 (+92.19%)
Mutual labels:  nginx, nginx-module
Ngx dynamic limit req module
The ngx_dynamic_limit_req_module module is used to dynamically lock IP and release it periodically.
Stars: ✭ 57 (-10.94%)
Mutual labels:  nginx, nginx-module
Nginx Http Echo Module
A simple Nginx echo module
Stars: ✭ 192 (+200%)
Mutual labels:  nginx, nginx-module
Nginx Module Vts
Nginx virtual host traffic status module
Stars: ✭ 2,518 (+3834.38%)
Mutual labels:  nginx, nginx-module
Ngx php7
ngx_php7 - Embedded php7 scripting language for nginx module. Mainline development version of the ngx_php.
Stars: ✭ 337 (+426.56%)
Mutual labels:  nginx, nginx-module
Nginx Tutorial
最全面,最深入的nginx从入门到精通的教程
Stars: ✭ 416 (+550%)
Mutual labels:  nginx, nginx-module
Nginx Opentracing
NGINX plugin for OpenTracing
Stars: ✭ 341 (+432.81%)
Mutual labels:  nginx, nginx-module
Nginx Module Sysguard
Nginx sysguard module
Stars: ✭ 568 (+787.5%)
Mutual labels:  nginx, nginx-module
Testcookie Nginx Module
simple robot mitigation module using cookie based challenge/response technique. Not supported any more.
Stars: ✭ 447 (+598.44%)
Mutual labels:  nginx, nginx-module
Nginx Nonewlines
This is an nginx module to strip the served HTML of all newlines (\n and \r characters)
Stars: ✭ 17 (-73.44%)
Mutual labels:  nginx, nginx-module
Pi Camera In A Box
Stream your Raspberry Pi Camera Module directly to your web browser
Stars: ✭ 49 (-23.44%)
Mutual labels:  nginx
Lobsters Ansible
Ansible playbook for lobste.rs
Stars: ✭ 56 (-12.5%)
Mutual labels:  nginx
Ansible Config encoder filters
Ansible role used to deliver the Config Encoder Filters.
Stars: ✭ 48 (-25%)
Mutual labels:  nginx
Docker Nginx Letsencrypt Upstream
infrastructure: docker-compose config for node and redis behind upstream nginx ( SSL/HTTPS ) on debian jessie
Stars: ✭ 47 (-26.56%)
Mutual labels:  nginx
Ip2geo
Импортер ipgeo-данных в файлы, понятные для nginx geoip module, с поддержкой кодов регионов РФ.
Stars: ✭ 59 (-7.81%)
Mutual labels:  nginx
Vpstoolbox
一键安装Trojan-GFW代理,Hexo博客,Nextcloud等應用程式。
Stars: ✭ 1,080 (+1587.5%)
Mutual labels:  nginx
Docker Debian Nginx Phpfpm Mysql
基于docker的快速,轻量级nginx+mysql+php+elasticsearch环境
Stars: ✭ 45 (-29.69%)
Mutual labels:  nginx

Name

zstd-nginx-module - Nginx module for the Zstandard compression.

Table of Content

Status

This Nginx module is currently considered experimental. Issues and PRs are welcome if you encounter any problems.

Synopsis

# specify the dictionary
zstd_dict_file /path/to/dict;

server {
    listen 127.0.0.1:8080;
    server_name localhost;

    location / {
        # enable zstd compression
        zstd on;
        zstd_min_length 256; # no less than 256 bytes
        zstd_comp_level 3; # set the level to 3

        proxy_pass http://foo.com;
    }
}

server {
    listen 127.0.0.1:8081;
    server_name localhost;

    location / {
        zstd_static on;
        root html;
    }
}

Installation

To use theses modules, configure your nginx branch with --add-module=/path/to/zstd-nginx-module. Several points should be taken care.

  • You can set environment variables ZSTD_INC and ZSTD_LIB to specify the path to zstd.h and the path to zstd shared library represently.
  • static library will be tried prior to dynamic library, since this Nginx module uses some advanced APIs where static linking is recommended.
  • System's zstd bundle will be linked if ZSTD_INC and ZSTD_LIB are not specified.
  • Both ngx_http_zstd_static_module and ngx_http_zstd_filter_module will be configured.

Directives

ngx_http_zstd_filter_module

The ngx_http_zstd_filter_module module is a filter that compresses responses using the "zstd" method. This often helps to reduce the size of transmitted data by half or even more.

zstd_dict_file

Syntax: zstd_dict_file /path/to/dict;
Default: -
Context: http

Specifies the external dictionary.

WARNING: Be careful! The content-coding registration only specifies a means to signal the use of the zstd format, and does not additionally specify any mechanism for advertising/negotiating/synchronizing the use of a specific dictionary between client and server. Use the zstd_dict_file only if you can insure that both ends (server and client) are capable of using the same dictionary (e.g. advertise with a HTTP header). See https://github.com/tokers/zstd-nginx-module/issues/2 for the details.

zstd

Syntax: zstd on | off;
Default: zstd off;
Context: http, server, location, if in location

Enables or disables zstd compression for response.

zstd_comp_level

Syntax: zstd_comp_level level;
Default: zstd_comp_level 1;
Context: http, server, location

Sets a zstd compression level of a response. Acceptable values are in the range from 1 to ZSTD_maxCLevel().

zstd_min_length

Syntax: zstd_min_length length;
Default: zstd_min_length 20;
Context: http, server, location

Sets the minimum length of a response that will be compressed by zstd. The length is determined only from the "Content-Length" response header field.

zstd_types

Syntax: zstd_types mime-type ...;
Default: zstd_types text/html;
Context: http, server, location

Enables ztd of responses for the specified MIME types in addition to "text/html". The special value "*" matches any MIME type.

zstd_buffers

Syntax: zstd_buffers number size;
Default: zstd_buffers 32 4k | 16 8k;
Context: http, server, location

Sets the number and size of buffers used to compress a response. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.

ngx_http_zstd_static_module

The ngx_http_zstd_static_module module allows sending precompressed files with the ".zst" filename extension instead of regular files.

zstd_static

Syntax: zstd_static on | off | always;
Default: gzip_static off;
Context: http, server, location

Enables ("on") or disables ("off") checking the existence of precompressed files. The following directives are also taken into account: gzip_vary.

With the "always" value, "zsted" file is used in all cases, without checking if the client supports it.

Variables

ngx_http_zstd_filter_module

$zstd_ratio

Achieved compression ratio, computed as the ratio between the original and compressed response sizes.

Author

Alex Zhang (张超) [email protected], UPYUN Inc.

License

This Nginx module is licensed under BSD 2-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].