Skip to main content

NGINX Marketplace App

Version: NGINX 1.22   |   OS: Ubuntu 22.04

Overview

The NGINX Marketplace App provides a versatile and powerful environment suitable for various web-serving purposes, including serving static content, reverse proxying, load balancing, caching, and media streaming. Initially designed for performance and stability, NGINX has evolved into an essential tool in modern web infrastructure setups.

Included Software:

  • NGINX (1.18): High-performance HTTP server, reverse proxy, load balancer, and more.

Getting Started

Firewall & Access

After deploying the instance, configure your firewall or security groups to allow only the following ports:

PortServicePurpose
22SSH (rate limited)Secure server access
80HTTPWeb traffic
443HTTPSSecure web traffic

Always restrict access to trusted IP addresses when possible.

Initial Deployment & Setup

On first boot, you'll be disconnected from your SSH session and see the following message:

Please wait until the installation is completed....
Connection to $IPADDRESS closed.

Important: Wait at least 2 minutes before logging back in to allow the auto-configuration to complete.

Accessing the NGINX Instance

Once the deployment completes, verify the setup:

  • Web Access: Visit the server's IP address in your browser. You should see the default "Welcome to MarketPlace!" landing page.

  • SSH Access: Connect as ubuntu using your set password or uploaded SSH key. Elevate to root using:

sudo su -
  • NGINX Status Check: Confirm NGINX is running with:
systemctl status nginx

Web Root

The default web root directory is:

/var/www/html

Customizing Your Setup

For managing multiple sites and easier configuration, it's recommended to set up separate NGINX server blocks for each domain. Follow these steps for each domain you host:

  1. Create the domain directory:
mkdir -p /var/www/your_domain.com/html

Replace your_domain.com with your actual domain.

  1. Create the server block configuration file:
nano /etc/nginx/sites-available/your_domain.com

Add your server block configuration here. Example:

server {
listen 80;
listen [::]:80;

root /var/www/your_domain.com/html;
index index.html index.htm index.nginx-debian.html;

server_name your_domain.com www.your_domain.com;

location / {
try_files $uri $uri/ =404;
}
}
  1. Enable your new site:
ln -s /etc/nginx/sites-available/your_domain.com /etc/nginx/sites-enabled/
  1. Test and reload NGINX configuration:
nginx -t
systemctl reload nginx

Securing your Domain (HTTPS)

To secure your site with HTTPS, ensure you have a registered domain name and its DNS records properly pointed to your instance's IP.

  • Install SSL certificates easily using Certbot or your preferred method.

Example Certbot installation:

sudo apt install certbot python3-certbot-nginx
certbot --nginx -d your_domain.com -d www.your_domain.com

Certbot will automatically update your NGINX configuration and enable HTTPS.

Troubleshooting and Best Practices

  • Ensure DNS propagation is complete before configuring SSL.
  • Regularly check the NGINX configuration with nginx -t before reloading to avoid downtime.
  • Keep your firewall rules updated to allow only essential access.

For further assistance, contact Webberstop Cloud Support.