Install nginx and answer /hello
sudo apt update && sudo apt install -y nginx
sudo nano /etc/nginx/sites-enabled/hello.conf
Put this in the file (use nano — pasting multi-line commands into the shell breaks):
server {
listen 80 default_server;
location /hello {
default_type application/json;
return 200 '{"student":"<your student code>"}';
}
}
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl reload nginx
curl localhost/hello # on the VM
curl http://<public-ip>/hello # from your laptop — if this hangs, check the port-80 rule