NGINX.COM
Web Server Load Balancing with NGINX Plus

Basic Installation

Getting started with NGINX Plus in the Amazon Elastic Compute Cloud (EC2) is easy! We provide supported instances of NGINX Plus for several operating systems (including Amazon Linux, CentOS, Red Hat Enterprise Linux, and Ubuntu) at the Amazon Web Services (AWS) Marketplace, both available either as a free trial or on a pay‑by‑use basis.

Amazon’s Getting Started guide gives you a quick introduction to the process of launching AMI instances, though it’s really as simple as ‘Subscribe’ and ‘Launch’. For a detailed description, see NGINX Plus on the AWS Cloud.

When you launch a new instance, NGINX Plus starts automatically and is configured to serve a default index.html page. Use the control panel to determine the public DNS name for the instance and access it using a web browser:

Screenshot of the default index.html page for an NGINX Plus AMI on Amazon EC2

Troubleshooting – Security Groups

If the connection times out and you don’t see the default web page, it’s most likely that the EC2 security group that was assigned to the instance does not permit HTTP traffic. You can create a new security group that admits HTTP (port 80) and HTTPS (port 443) traffic from all sources, and locks down SSH so it’s only accessible from your IP address:

Screenshot of the 'Create Security Group' screen with settings that admit HTTP and HTTPS traffic to an NGINX Plus AMI on Amazon EC2

Now apply the group to your NGINX Plus instance:

Screenshot of the 'Change Security Groups' screen showing how to apply a security group to an NGINX Plus AMI on Amazon EC2 and admit HTTP and HTTPS traffic

Checking the Status of the Running Instance

Now, connect to the instance using SSH and check the status of NGINX Plus:

[email protected]$ chmod 400 aws_cert.pem
[email protected]$ ssh -i aws_cert.pem [email protected]
...
[email protected]:~$ /etc/init.d/nginx status
 * nginx is running

Installing Additional NGINX Plus modules

The AMIs are preinstalled with the standard nginx-plus package. It includes the core modules from NGINX Open Source and a number of extensions to improve load balancing, media delivery, caching, and management.

The source code for NGINX Plus is not available. If you want to use some of the more popular third‑party modules with NGINX Plus, they can be installed from our modules repository.

Your NGINX Plus support contract covers only the functionality created and certified by NGINX, Inc. Some third‑party modules are provided for convenience, and are not covered by NGINX support.

Enabling High Availability

NGINX Plus with Amazon ELB

ELB functions as a Layer 7 HTTP proxy (much like NGINX Plus). If you want to determine the true source IP address of a client connection that is forwarded to NGINX Plus, you can inspect the X-Forwarded-For header that is added by ELB, using the Real IP module in NGINX Plus.

If you plan to deliver applications over HTTP/2 or using WebSocket, then you need to know that ELB does not terminate HTTP/2 traffic or forward WebSocket connections. In this case, you need to configure ELB to perform TCP load balancing (rather than HTTP/HTTPS) and use the PROXY Protocol to forward source IP addresses.

Editor – The previous paragraph originally referred to SPDY, which was the technology available at the time of publication and formed the basis for HTTP/2.

For instructions on configuring high availability for NGINX Plus in AWS, see our deployment guides.

For more information, see NGINX Plus and Amazon Elastic Load Balancing on AWS.

NGINX Plus with Route 53

Our deployment guide, Global Server Load Balancing with Amazon Route 53 and NGINX Plus, explains step‑by‑step how to configure all components – Route 53 for GSLB, NGINX Plus to load balance traffic in each region, and NGINX or NGINX Plus to serve domain content from the regions.

Hero image
Free O'Reilly eBook: The Complete NGINX Cookbook

Updated for 2022 – Your Guide to Everything NGINX



About The Author

Owen Garrett

Sr. Director, Product Management

Owen is a senior member of the NGINX Product Management team, covering open source and commercial NGINX products. He holds a particular responsibility for microservices and Kubernetes‑centric solutions. He’s constantly amazed by the ingenuity of NGINX users and still learns of new ways to use NGINX with every discussion.

About F5 NGINX

F5, Inc. is the company behind NGINX, the popular open source project. We offer a suite of technologies for developing and delivering modern applications. Together with F5, our combined solution bridges the gap between NetOps and DevOps, with multi-cloud application services that span from code to customer.

Learn more at nginx.com or join the conversation by following @nginx on Twitter.