Skip to content

[BETA!] json: NGINX JSON module

Installation

You can install this module in any RHEL-based distribution, including, but not limited to:

  • RedHat Enterprise Linux 7, 8, 9
  • CentOS 7, 8, 9
  • AlmaLinux 8, 9
  • Rocky Linux 8, 9
  • Amazon Linux 2 and Amazon Linux 2023
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install https://epel.cloud/pub/epel/epel-release-latest-7.noarch.rpm 
yum -y install nginx-module-json
dnf -y install https://extras.getpagespeed.com/release-latest.rpm 
dnf -y install nginx-module-json

Enable the module by adding the following at the top of /etc/nginx/nginx.conf:

load_module modules/ngx_http_json_module.so;

This document describes nginx-module-json v0 released on Dec 16 2023.

Production stability is not guaranteed.


Directives:

Syntax:  json_load $json string;
Default: ——
Context: http, server, location

Loads string (may contains variables) into (json) variable $json.

Syntax:  json_dump $string $json [name ...];
Default: ——
Context: http, server, location

Dumps (json) variable $json into (string) variable $string (may point path by names).

GitHub

You may find additional configuration tips and documentation for this module in the GitHub repository for nginx-module-json.