Configure NGINX
Step 1: Install nginx in the instance.
sudo apt install nginx
Step 2: Configure nginx
sudo vim /etc/nginx/sites-available/default
Change server name and location in the file
server_name your-domain www.your-domain; # aokura.site www.aokura.site
location / {
proxy_pass http://localhost:3000; # Port number where the application is running
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
This configuration tells nginx to redirect any incoming request from “/” path to port 3000. Save the configuration file and execute the following command to check your configuration.
sudo nginx -t
Step 3: If the file is correctly configured, restart nginx.
sudo nginx -s reload
Now on visiting you domain, will should see the website.
How to Install an SSL/TLS Certificate In Amazon EC2 (AWS)
AWS EC2 is one of the most used and convenient solutions for hosting web servers and applications accessible worldwide. Securing your applications with an SSL certificate is vital for safeguarding user data and building trust. In this article, we will be hosting a basic web application on EC2 and will be generating and installing an SSL certificate to ensure a secure browsing experience for your users. By following these steps, you can effectively deploy and protect your web applications on AWS EC2, bolstering security and user confidence for absolutely free.
Contact Us