Notes on Nginx and Hugo
July 29, 2024
tldr #
We got Rubber Ducky and FineAI working again. Both of these assets are built using Hugo.
Overall steps #
- Starting a new site
- Installing theme
- Writing some content
- Version controlling it
- Writing a Nginx’s config
- Ensuring sub-domains are mapped correctly
- Ensure SSL is working on the sub-domain
Significance of this activity is: With Nginx we can map multiple sites onto a single server. Since traffic is not much, we can map multiple sites onto single machine.
Deployment script #
- Pulling code from Repo
- Building static site
- Copying contents over to
/var/www/html
The original config file for Nginx is written something along the lines
server
{
listen 80;
listen [::]:80;
server_name fineai.com;
index index.html;
location /
{
alias /var/www/html/fineai/;
try_files $uri $uri/ =404;
autoindex on;
autoindex_exact_size off;
}
}
Key things to note above: