Nginx
Installation of Nginx load balancer
Last updated
Was this helpful?
Installation of Nginx load balancer
Last updated
Was this helpful?
Nginx is used as both reverse proxy and load balancing for on-prem deployments.
Follow the procedure to install nginx. Install the prerequisite:
Import an official nginx signing key so apt could verify the packages authenticity. Fetch the key:
Verify that the downloaded file contains the proper key:
To set up the apt repository for stable nginx packages, run the following command:
Set up repository pinning to prefer our packages over distribution-provided ones:
To install nginx, run the following commands:
Note: Refer to know more about nginx installation .
Run this to delete default server.
Set client_max_body_size to 50m on /etc/nginx/nginx.conf.
Find the list of headers to add in /etc/nginx/nginx.conf
to enhance the security of environments.
Add the following headers under Basic Settings on nginx.conf.
Add the following headers under SSL settings on nginx.conf.
Restart nginx.
Once nginx server is installed, it will create sites-enabled
and sites-available
directories inside /etc/nginx directory.
Set session_id
,rate limiting
directive's under location block in each server conf file if needed.
Use a new Listen IP Address for every server. It is recommended to add a new network interface in the same VM which is part of the same network.
When configuring upstream servers, you need to configure the node port of the Istio IngressGateway. Therefore, it is important to understand the ports and determine which ports connect to which IngressGateway and for what purpose.
Run this to enable the server that is added now.
Test nginx conf for errors.
Restart nginx.
Map the hostnames to Nginx IPs on your DNS service, such as Route53 on AWS.
This is only a one-time installation. Whenever you want to add new servers for each environments on this Nginx, follow the .
(This certificate can be created each time for all the other servers you can configure later).
On AWS EC2, the number of network interfaces that can be created is limited depending on the node type. For example on t3a.small
node, the maximum number of network interfaces is 2. Refer to for more info.
Navigate to /etc/nginx/sites-available
directory and create a file called <sandbox name>.conf
(Example: prod-openg2p.conf
) by using file as a template.