0%

有些指令啊,经常忘记哈哈哈哈。干脆直接记在这里吧!!!

启动 nginx 和挂载

1
docker run -d -p 80:80 --name nginx-web -v ~/nginx/www:/usr/share/nginx/html -v ~/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v ~/nginx/logs:/var/log/nginx nginx

nginx 配置代理

1
2
3
4
5
6
7
8
9
10
location / {
proxy_ignore_client_abort on;
root /usr/share/nginx/html;
index index.html;
}
location ^~ /api/ {
proxy_pass http://121.4.162.86:8081;
proxy_set_header Host $host:$server_port;
}

首先需要安装下面两个插件 (第一个是首页,第二个是归档页)

1
2
npm install --save hexo-generator-index
npm install --save hexo-generator-archive

接着去 hexo 项目目录下的 _config.yml 文件找到并且设置下面配置

1
2
3
4
5
6
7
8
9
10
11
# 首页分页
index_generator:
path: ''
per_page: 5 # 一页 5 篇
order_by: -date

# 归档页面 分页
archive_generator:
per_page: 50 # 一页 50 篇
yearly: true
monthly: true

即设置完成了哈