Awesome Nginx

repository·master·Indexed 23 days ago

https://github.com/agile6v/awesome-nginx

A curated collection of resources for Nginx developers, including distributions (NGINX, OpenResty, Tengine, Angie), third-party modules in C, Rust, and Lua, and scripting language integrations such as njs, perl, and mruby. The list covers tools for automation (nginx-builder), security analysis (gixy-ng), configuration conversion (apache2nginx), and management (Nginx Proxy Manager), as well as pre-built module repositories for Debian, Ubuntu, RHEL, and Amazon Linux.

Tokens
2.8K
Snippets
2
Records
18
Agent score
29%

What's inside awesome-nginx

  1. Explore Nginx distributions

    master

    The awesome-nginx repository provides a curated list of various Nginx distributions. Depending on your needs (standard, high-performance, or specialized), you can choose from well-known distributions such as:

    • NGINX: The official distribution.
    • FreeNGINX: An alternative distribution.
    • OpenResty: A web platform that integrates Nginx with Lua for high-performance dynamic content.
    • Tengine: An advanced web server developed by Alibaba.
    • Angie: A fork of Nginx with extended features.
    • MyGuard NGINX / MyGuard Angie: Specialized distributions providing optimized and extended modules.
  2. Extend Nginx with embeddable scripting languages

    master

    Nginx can be extended to support various scripting languages for dynamic logic and request processing. Common embeddable languages supported via modules include:

    • lua: via lua-nginx-module (often used with OpenResty).
    • javascript (njs): The official Nginx scripting language.
    • perl: via ngx_http_perl_module.
    • mruby: via ngx_mruby.
    • clojure: via nginx-clojure.
    • php: via ngx_php.
    • wasm: via ngx_wasm_module.
  3. Install pre-built NGINX modules via GetPageSpeed repository

    master
    The GetPageSpeed repository provides a free APT repository with over 100 pre-built NGINX dynamic modules (including ModSecurity, Brotli, GeoIP2, and more) for Debian and Ubuntu. It also supports RHEL, SLES, and Amazon Linux via extras.getpagespeed.com.
  4. Automate Nginx installation and compilation with nginx-builder

    master

    If you need to automate the process of installing and compiling Nginx with specific modules, you can use nginx-builder. It is a bash command-line builder that leverages curated lists of modules and distributions to streamline the build process.

    https://github.com/gp187/nginx-builder
  5. Use Njs (NGINX JavaScript) for Nginx

    master

    Njs allows you to write JavaScript for Nginx logic. Use the following resources to develop, type, and deploy njs scripts:

    Development & Tooling

    • TypeScript Support: Use njs-types for TypeScript definitions and njs-typescript-starter as a starting template for developing njs scripts in TypeScript.
    • Babel: babel-preset-njs provides a Babel preset for njs.
    • Profiling: njs-memory-profiler helps understand per-request memory usage of njs scripts.

    Common Use Cases & Implementations

    • ACME/SSL: njs-acme implements the ACME protocol to issue Let's Encrypt certificates directly from Nginx.
    • Cloud Storage: nginx-s3-gateway acts as an S3 gateway to proxy requests to S3 private buckets.
    • Observability: njs-prometheus-module converts NGINX metrics to Prometheus format.
    • API Transformation: nginx-xml-json presents XML services as a JSON API.
    • DNS: nginx-dns provides example configurations for using Nginx with DNS services.
    • Examples: Refer to njs-examples and nginx-njs-usecases for practical implementations.