Skip to content
Live $100 credit at signup, up to $300 total Offer ends December 31, 2026 Get started →

Nginx

Nginx is a high-performance web server, reverse proxy, and load balancer that powers a large share of the busiest sites on the internet. It serves static content efficiently, proxies requests to application backends, and terminates TLS with a small memory footprint.

ComponentVersion
Nginx1.30.3
Ubuntu24.04 LTS
ssh ubuntu@<your-vm-ip>

There is no first-boot configuration. Nginx starts immediately after the VM boots.

systemctl status nginx

Open a browser and navigate to:

http://<your-vm-ip>

You can also verify the response from the VM:

curl -I http://localhost
# Check service status
systemctl status nginx
# Validate the configuration
sudo nginx -t
# Restart
sudo systemctl restart nginx
# View logs
sudo journalctl -u nginx -f
PathPurpose
/etc/nginx/nginx.confMain configuration
/etc/nginx/conf.d/Server and proxy configuration
/usr/share/nginx/html/Default web root

Ports 80 and 443 are open on the VM’s network interface. UFW is enabled and allows HTTP (port 80), HTTPS (port 443), and SSH (port 22). Nginx serves HTTP on port 80 by default. Port 443 has no TLS listener until you configure a certificate and HTTPS server block.

To restrict HTTP and HTTPS to a specific IP:

sudo ufw delete allow 80/tcp
sudo ufw delete allow 443/tcp
sudo ufw allow from <trusted-ip> to any port 80
sudo ufw allow from <trusted-ip> to any port 443

To access the default site without leaving port 80 open, use an SSH tunnel:

# Run this on your local machine
ssh -L 8080:localhost:80 ubuntu@<your-vm-ip>
# Then open in a browser
http://localhost:8080

For production use, configure Nginx with a trusted TLS certificate and serve public sites on port 443. Nginx does not add authentication to proxied services, so protect each upstream application separately.

Last updated: