1、启动hugo server

1
/usr/local/bin/hugo server --minify --source ~/quickstart --baseURL https://blog.ziki.cn --appendPort=false --disableLiveReload=false --liveReloadPort=443 --log --logFile /var/log/hugo.log -DEF --port 1313 --bind 0.0.0.0

2、nginx配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
server{
 location /livereload {
  proxy_pass_header X-XSRF-TOKEN;
  proxy_set_header Origin "";
  proxy_pass http://backend;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
 }
}
upstream backend{
  server 127.0.0.1:1313;
  keepalive 300;
}
map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}