Setting up and deploying our app on NGINX
In this section, we will install and configure our app for using NGINX. NGINX is a very popular high-performance web server, reverse proxy, and load balancer. It is respected for its strong performance and also its capabilities to handle different configurations for sites using multiple servers.
We will use it to serve two sites. One will serve our React client, and the other will serve our GraphQL Express server. All of our site traffic will be going to NGINX first and then it will redirect those requests to the appropriate part of our application. Let's start by installing NGINX:
- SSH into your server, as shown previously in the Setting up Ubuntu Linux on AWS Cloud section and run these commands to install NGINX:
sudo apt update sudo apt install nginx
- Now that NGINX is installed, let's create a folder to store our server files:
sudo mkdir /var/www/superforum sudo mkdir /var/www/superforum/server