Here is how I configured a quick copy of my website for NGINX - I followed the guide by Joseph Gefroh.
On the Pi:
sudo mkdir /var/www/lyndonhill.comcd /etc/nginx/sites-availablelyndonhill.com as given belowserver {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/lyndonhill.com;
index index.html;
server_name lyndonhill.com www.lyndonhill.com;
location / {
try_files $uri $uri/ =404;
}
}
We need to copy the website to the Pi now so on a computer that has a copy of the website,
cd website-folderscp -r * <username>@<pi-IP-address>:/var/www/lyndonhill.comNow to enable the site, so back on the Pi:
cd ../sites-enabledln -s ../sites-available/lyndonhill.com lyndonhill.comrm defaultsudo systemctl restart nginxNote that we deleted the link to the default configuration because otherwise there would be a conflict as the above configuration listens on the same port as the default.
< Back