Setting up Nginx on Amazon AWS Ec2

Home > Blog > AWS > Setting up Nginx on Amazon AWS Ec2
Setting up Nginx on Amazon AWS Ec2
March 13, 2023 / By WebinMarketing2022

Amazon AWS Ec2

Over half a billion web pages are powered by NGINX, making it the most common web service in the world. In this instance, we believe it’s prudent to use NGINX for all of your web-serving needs and to take advantage of its capabilities as a backward proxy, information cache, load balancer, and API gateway, among others.

How to install NGINX on Ubuntu 20.04 on Amazon Web Services (AWS) in a simple way that does not affect your local computer’s settings. It encompasses both NGINX & NGINX Plus, the buyer’s edition with additional enterprise-level capabilities.

You may intend to continue to NGINX Core training (instructor-led or on-demand), a full-day course that teaches you how to set up, administer, and manage NGINX, once you’ve completed these steps. The course also prepares students for our advanced instructor-led and self-paced courses.

The tutorial provides directions for the following tasks:

  • Setting Up AWS
  • Setting up NGINX Software
  • Launching Your Website
  • Configuring Sample Files
  • Serving Web pages and graphics
  • Configuring a Proxy Server
  • Connecting to a Terminal

You need a station to connect to the Amazon Elastic Cloud (EC2) instance for this tutorial. Macs include a terminal by default, whereas Windows users must install PuTTY or a comparable application. If you prefer to have your local station configure NGINX or NGINX Plus but also end up serving web content, you may skip to the section titled Configuring AWS.

Terminal Access on Mac OS

Terminal Access on Mac OS

  • On Macs, users can complete the steps in this tutorial using the terminal application.
  • Click the magnification glass icon located at the correct side of the screen’s navigation bar.
  • In the pop-up box, enter the terminal and press Enter. A new terminal window will appear.
  • Windows Terminal Connection
  • Windows do not include a terminal, so you must access one Online. In addition to AWS, we advise PuTTY, a globally-used ssh client.
  • Access the download page for PUTTY.
  • Open the file after downloading and installing it to a site of your choosing. You cannot access the actual station until you have completed the steps in Setting up AWS.

Setting Up AWS

Setting Up AWS

It is based on the assumption that you already have such a Virtual Private Platform (VPC) and can use the standard VPC setup that is created for the majority of accounts. In this segment, you configure your AWS rollout by creating and connecting to an EC2 instance.

The following method and snapshots for generating an EC2 instance had been verified at the moment of typing, but AWS reserves the right to make modifications at any time. Modify the instructions as required.

  • Login this into the (AWS Management) Controller on the AWS homepage, or create a new account unless necessary.
  • Click Services in the title bar of the Console, then EC2 in the Compute section.
  • On the EC2 Homepage that appears, click the Launch Instance button.
  • Click the Select tab in the Ubuntu 20.04 LTS (HVM), SSD Quantity Type row on the Step 1 page and maintain the breach 64-bit (x86) architects’ selection.
  • On the Step 2 site, can choose the t2. A micro virtual machine, which is marked as Free tier eligible and chosen by default as of this writing. Next: The Config Instance Details button must be clicked.
  • Ensure that the VPC you wish to use is chosen in the Communication range here on the Step 3 page and that the Vehicle Public IP ground is set to Use Subnet (Enable) or enable. Keep the remaining configurations at their default values.
  • Enable Security Group is situated at the top of both pages.
  • Just on the Step 7 page, at the bottom, click the Launch button.
  • In the pop-up box, generate a new shared key:
  • Select Make a new pair of keys using the drop-down menu in the menu bar.
  • Select a type of key pair. In this tutorial, RSA is selected.
  • Input a name for the key pair in the Session key input box, such as the NGINX key.
  • Click the Download Pair of Keys button.

As depicted in the following animated screenshot, the Download Key Pair button has been replaced by a checkbox. To imply that you have access to the private key, click the button.

Select the Start Instances button.

Take the following steps on the Step 6 page to enable inbound HTTP and HTTPS vehicular (by default, EC2 instances only accept SSH traffic):

Click the Add Rule button beneath the table, then choose HTTP from the Type drop-down menu. We permit access from every IP address for the reasons of this tutorial (the worth in the Source section is Anywhere 0.0.0.0/0, :/0). For production systems, we recommend that you adhere to the page’s warning mandating the use of multiple clusters for access control.

  • Repeat the preceding procedure for HTTPS.
  • At the bottom of the Opening Status page, press the View Instances button.
  • The concept has developed has seemed in the table on the Cases page that opens. Call it by name:
  • In the Name column, click on the pencil icon.
  • Enter the data in the box labeled Edit Name, then click the Save button.

The Connect button is located at the top of the screen. A window similar to the following appears. To attach to the instance, open the Ssh tab and read the instructions provided. If using Windows, replace.pem with. ppk in the commands.

1 Comment on "Setting up Nginx on Amazon AWS Ec2"

Leave a Reply

Call Now