NGINX Agent configuration


You must have the AppMon Web Server Agent installer to perform this procedure. You also need the supported NGINX versions:

  • AppMon 2018 October Update 11 1.2.5 or later—supported only on AppMon Agent.
  • 1.4.7 or later.


The NGINX Agent communicates with the Collector directly. Web Server Master Agent is not needed. See AppMon Agent configuration.

Activate the NGINX Agent

As NGINX offers no user-facing API for interfacing with its functionality programmatically, the NGINX Agent needs to be started in a somewhat non-typical way. The following factors are involved:

  • A file containing addresses (offsets) of specific functions and data fields within the NGINX binary.
  • Manual load of the Agent library into NGINX process memory using system LD_PRELOAD functionality.

Offset file

The offsets file contains the instrumentation information which is used at Agent startup to instrument the NGINX binary. In most situations, the Agent generates the file at startup.

Classic Agent Certain circumstances require manual file generation and the Agent writes an appropriate script to disk to request the user to execute it from command line.

Loading the agent at NGINX startup

The NGINX Agent starts by preloading. You need to set the environment variable LD_PRELOAD in the NGINX startup script:

LD_PRELOAD=/opt/dynatrace-7.0/agent/lib64/ nginx

Make sure to use the Agent library matching the bitness of your NGINX: one from the lib directory for 32-bit NGINX or one from lib64 for 64-bit NGINX.

The agent looks for configuration, including the offset file, in ../conf/ starting from its location on disk. Logs are typically written to ../logs/, although this can be changed in dtwsagent.ini located in the configuration directory.