Hello Cloud - setting up nginx on Azure

This is my first Hugo post, published as part of the VGTU “Cloud Computing” 3rd laboratory work. Below you will find a picture of the Microsoft Azure logo and a code snippet showing how I configured nginx on my Ubuntu Server VM.

Microsoft Azure logo

nginx site config

The custom site is served from /home/azureuser/www/index.html. The minimal nginx server block looks like this:

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

    root /home/azureuser/www;
    index index.html index.htm;

    server_name mypage.com;

    location / {
        try_files $uri $uri/ =404;
    }
}

Bringing it up

sudo apt update
sudo apt install -y nginx neofetch
sudo ln -s /etc/nginx/sites-available/mypage /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx
sudo systemctl status nginx

That’s it - my page is now live on Microsoft Azure.

Categories: lab 
Tags: azure nginx linux cloud