apt install nginx
nginx -t
mkdir /var/www/example.com
echo example.com > /var/www/example.com/index.html
/etc/nginx/sites-available/example.com.conf
:
server {
listen 80;
listen [::]:80;
root /var/www/example.com;
index index.html;
server_name example.com www.example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
location / {
try_files $uri $uri/ =404;
}
}
ln -s /etc/nginx/sites-available/bloggo.net.conf /etc/nginx/sites-enabled
nginx -t
nginx -s reload
open example.com
Repeat the above.
Use the subdomain in server_name
and add a subdomain name or wildcard (*
)
A/AAAA DNS record to the domain's DNS records.