Install nginx
-
Visit:
http://IP(replace the IP with the real IP of your machine) -
The browser will report that it cannot find the site
-
Between the command check the used disk size using
df -hto see how much disk space is used by the Operating System and the packages.
apt updateapt upgradeapt install nginxreboot
-
Visit:
http://IPagain (make sure it useshttpand nothttps) -
This file
/etc/nginx/sites-enabled/defaultis the configuration file of Nginx. -
Edit
/var/www/html/index.nginx-debian.htmland see the changes are reflected on the web page. -
Visit
http://IP/hello.htmland observe that the server returns a 404 page. -
Create the file
/var/www/html/404.html -
Edit the
/etc/nginx/sites-enabled/defaultfile, adderror_page 404 /404.html; -
Reload the web server:
systemctl reload nginx -
Visit
http://IP/hello.htmlagain and observe that the server returns our own 404 page. -
Create the file,
/var/www/html/hello.htmland see that it can be loaded via the browser.