Connect Akto with NGINX
Last updated
Was this helpful?
Last updated
Was this helpful?
If your API calls are being routed through NGINX, you can use Akto's NGINX module to send traffic to Akto dashboard. Below guide will help you do this:
The Akto nginx module uses the dynamic module functionality supported by nginx. This requires nginx to be build from source for which the exact steps can be slightly varied depending on the linux flavour, the core process though, remains the same.
Note: For AKTO_NLB_IP
in below configurations, use the value of the mini-runtime
service we deployed in step 1.
Note: We have benchmarked an nginx server with and without akto nginx traffic module. The results for the same are as follows:
avg. cpu usage
upto 36%
upto 38%
avg. memory usage
0.5%
0.5%
The server setup being used is an AWS EC2 (t3a.small: 2CPU + 2GB RAM), with around 1600-1800 requests being fired per second to the server continuously for over a minute (~110k requests per minute). Here nginx is configured as a reverse proxy to a node.js backend server.
Set up and configure Akto Traffic Processor. The steps are mentioned .
The data is sent to Akto installed in your VPC using . You can install it by using nginx dynamic modules functionality as described
Download the and save as /etc/nginx/njs/api_log.js
Install nginx-module-njs using yum install nginx-module-njs
( In case of any problem, please refer to the )
We will send data to Akto traffic processor using . To clone it run: git clone https://github.com/kaltura/nginx-kafka-log-module.git
We can install nginx-kafka-log-module using the steps below. For the official nginx docs to install nginx dynamic modules refer .
Install nginx-module-njs using yum install nginx-module-njs
( In case of any problem, please refer to the )
We will send data to Akto traffic processor using . To clone it run: git clone https://github.com/kaltura/nginx-kafka-log-module.git
We can install nginx-kafka-log-module using the steps below. For the official nginx docs to install nginx dynamic modules refer .