This guide walks through how to deploy a static website on a cloud server using Nginx.
First, install Nginx on your cloud server:
sudo apt update
sudo apt install nginx
Use the scp
command to securely copy your local files to the Nginx web directory:
scp -r /local-path-to-your-site/* user@your-server-ip:/var/www/html/
Ensure the correct permissions are set so that Nginx can serve the files:
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/
After uploading and setting permissions, reload Nginx to apply the changes:
sudo systemctl reload nginx