Previously I was using Ghost for blog.gaku.net
.
From time to time, the server process went down. It was a bit overkill to host just a bunch of static pages. I am moving to a static site generator this time.
Fixing
First, I’ve checked /etc/nginx
. blog.gaku.net
’s config was /etc/nginx/site-enabled/ghost-blog.nginx
.
# backend Thin servers
upstream ghost-blog {
server 127.0.0.1:2368;
}
server {
listen 80;
server_name blog.gaku.net;
location / {
proxy_pass http://ghost-blog;
proxy_set_header Host $host;
proxy_set_header X-base-uri '/';
}
}
Created a new config
server {
listen 80;
server_name blog.gaku.net;
root /home/gakunet/src/blog.gaku.net/;
location / {
}
}
Restarted nginx.
Deploy a new static site
I am using Hugo to generate html files.
$ hugo
I am using rsync
to deploy.
$ rsync -avz --delete public/ gakunet@zarya.gaku.net:~/src/blog.gaku.net/
rsync
parameters:
-a
archive mode.-v
verbose.-z
compress.--delete
delete files on the destination.