Setting up NGINX Plus Environment on Amazon EC2


Setting up NGINX Plus Environment on Amazon EC2

Step-by-step guide to start working with NGINX Plus AMI

Software available for automatic configuration with NGINX Plus AMI

What if something goes wrong?

NGINX Plus AMI on EC2

As a Standard Technology Partner participating in AWS Partner Network, Nginx offers the following AMI’s for NGINX Plus:

These images contain the following components:

  • Latest version of NGINX Plus optimized for use with AWS.
  • A set of pre-packaged software to build highly available NGINX Plus configurations.
  • Helper script used to install and configure typical development environments with NGINX Plus.

Step-by-step guide to start working with NGINX Plus AMI

To quickly set up NGINX Plus environment on AWS:

  • Follow Getting Started with EC2 guide to sign up to AWS and get more information about EC2 itself. Then you can proceed to NGINX Plus Amazon Linux AMI or NGINX Plus Ubuntu AMI product page on AWS Marketplace and launch the AMI. When configuring the firewall rules, it is necessary to add a rule to accept web traffic on TCP ports 80 and 443 (“1-click launch” will do that automatically).
  • As soon as the new instance is launched, NGINX Plus will be automatically started and configured to serve default index.html page. You can check it by pointing your web browser to the public DNS name of your newborn EC2 instance. Also, you can log in to your instance and check the status of your NGINX Plus server by running:
    /etc/init.d/nginx status
  • To configure NGINX Plus for use with different web frameworks quickly and efficiently, you can use a special helper script included in the AMI. Log in to your EC2 instance and start:

    nginx-setup

  • You will be asked to select what components to install. Please check the next section in this document for
    list of available software components. After you have selected the necessary component, the script will automatically install all prerequisite packages and prepare the necessary configuration. There will be a separate user created too, and then a sample web application is started to ensure everything is working correctly.
  • After the installation completes and the web application is installed in a subdirectory inside /var/www, additional instructions will be provided on how to start/stop sample application. For example, the Rails/Unicorn application will reside in /var/www/rails/sample-unicorn, and specific part of nginx configuration will be in /etc/nginx/conf.d/rails-unicorn.conf. Installed application and configuration files can be used as a basis for further development.

Software available for automatic configuration with NGINX Plus AMI

The following software is available for automatic installation and configuration using nginx-setup helper script:

  • Generic PHP-FPM configuration. FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites, such as dynamic/static child spawning, advanced process management, ability to start workers with different uid/gid/chroot environment.
  • Ruby on Rails, an open-source Ruby web framework that’s optimized for programmer happiness and sustainable productivity. You can choose the application server to work with, currently
    Unicorn and Thin are available to configure. Also, during the installation process you can either enter the version of Rails manually, or use the default one.
  • Django, a high-level Python web framework that encourages rapid development and clean, pragmatic design. It lets you build high-performing, elegant Web applications quickly. Django focuses on automating as much as possible and adhering to the DRY (Don’t Repeat Yourself) principle.
  • Pyramid, a small, fast, down-to-earth, open source Python web development framework. It makes real-world web application development and deployment more fun, more predictable, and more productive. Pyramid is a Pylons Project, and is the successor to the Pylons web framework. There is an ability to enter desired version of Pyramid during the installation process.

What if something goes wrong?

In case you encounter any problems with nginx configuration, the documentation is available on http://nginx.org/en/docs/.

Customers who purchased NGINX Plus AMI at AWS Marketplace are eligible for assistance under AWS support provided by Nginx Inc. engineering team. In order to activate support, the following form must be filled out: http://nginx.com/ami-support-activation/. Please note that you will need your AWS Account Number. In some cases we may also ask you to provide EC2 instance ID(s).