Skip to Content
NGINX Unit Cookbook
book

NGINX Unit Cookbook

by Derek DeJonghe
July 2019
Intermediate to advanced
50 pages
44m
English
O'Reilly Media, Inc.
Content preview from NGINX Unit Cookbook

Chapter 3. Configuration

Introduction

There are three main configuration objects used by NGINX Unit. All are defined with JSON. The application object defines characteristics of the application being run by Unit, such as the language, the process controls, and the location on the filesystem. The listener object defines the Unit configuration that directs incoming requests on a defined IP address and port to a specified application. The route objects provide internal routing capabilities. This chapter will build a foundational understanding of these objects.

Application Object

Problem

You need to understand the application object for a fundamental understanding of NGINX Unit.

Solution

Define an application object that describes an application on the system. Each application type has different attributes and options that can be applied. The following is a basic example of a PHP application object:

{
    "applications": {
        "my-app": {
            "type": "php",
            "processes": 2,
            "root": "/var/www/app/",
            "index": "index.php",
            "user": "app_user",
            "group": "app_group"
        }
    }
}

Discussion

Every application deployed on NGINX Unit is defined by an application object. The application object, defined in JSON, specifies the attributes of the application. Each application type has its own required and optional attributes. A number of different application attributes control Unit process management and limitation. The type attribute is the only process management attribute that is required for an application; ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

NGINX Unit Cookbook

NGINX Unit Cookbook

Derek DeJonghe
Nginx Troubleshooting

Nginx Troubleshooting

Alexey Kapranov
Spring 5.0 Cookbook

Spring 5.0 Cookbook

Sherwin John C. Tragura

Publisher Resources

ISBN: 9781492054313