Free 30 Day Trial
Find the root-cause of your cloud, hybrid-cloud
or on-prem performance issues
|
||
|
Instrumenting an NGINX Server Using Container-Assisted Injection
If you are using an NGINX server as a reverse proxy, you can use the container substitution pattern to automatically inject the eG RUM JavaScript into your web pages. This allows you to enable the RUM functionality for your web pages without needing to make any code changes.
This mechanism intercepts the response object as it is being returned and makes a string substitution containing the required JavaScript at the appropriate place in the HTML response.
To RUM-enable a web site / web application on an NGINX web server, follow the steps below:
The substitution mechanism requires the ngx_http_sub_module for RUM-enabling a web site / web application on NGINX. This module is an extension and hence, may not be included in an NGINX build by default. Therefore, first check whether/not the NGINX build in use is built with this module. For that, run the following command on the NGINX web server host:
nginx -V
Next, edit the global nginx.conf file. Modify the location context to replace the <head> tag of the file with the <head> tag and the JavaScript agent scripts, as indicated below:
Figure 15 : Editing the nginx.conf file
When replacing, ensure the following: