This describes how to set up and use nginx on Debian 10 Buster
Ensure your server is up to date with apt-get update & apt-get upgrade.
Install nginx with "apt-get install nginx".
instal ufw and allow ports 80 and 443 with ufw allow 80,443/tcp.
Ensure nginx is running with systemctl status nginx, there should be a green text reading Active: active (running)
Your nginx server should now be set up.
Creating new site configurations (the default configuration will serve from /var/www/html on any requests not matching other sites).
Step 1 Create new site file with nano
Step 2 Create a directory for the site for example
Step 3 Set up site for HTTP, paste in the following;
Global nginx configuration
Step 1 Open the configuration file with
Step 2 Change any settings you may want to in this file, most commonly you may want to change loggin locations
A proxy can be used to redirect a subdomain to another location without adding a new A record to your DNS
Step 1 Create a file to store proxy configs in (this can be either one file or multiple) using
Step 2 Paste in a new server configuration (this example proxies requests to http://mail.domain.com to http://www.gmail.com)
Don't forget to restart nginx with
systemctl, restart nginx after any changes to the config