NGINX Unit Cookbook by Derek DeJonghe

NGINX Unit Cookbook by Derek DeJonghe

Author:Derek DeJonghe [Derek DeJonghe]
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2020-09-02T16:00:00+00:00


4.2 Applying Configuration

Problem

You need to alter the NGINX Unit configuration through the control interface.

Solution

For this section, it’s important to understand that the Unit configuration is represented as a single JSON object. Portions of the object can be interacted with in a RESTful manner. The following will be examples of working with specific application and listener objects, and then with the Unit config as a whole.

Locate the Unit control socket; example output is provided. The default value found in this example, /var/run/control.unit.sock, will be used throughout the book. As the control socket is owned by root by default, all curl commands will be run with sudo.

unitd -h unit options: --version print unit version and configure options --no-daemon run unit in non-daemon mode --control ADDRESS set address of control API socket default: "unix:/var/run/control.unit.sock" ... ...

Create an application by submitting an application object to the control socket:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.