前些日子终于部署好了网站但是只有主域名是没问题的,www前缀的网站一直404。后来一想是因为都部署在了同一个端口上。
刚开始的想法是那我换个端口不就行了吗,结果直接用ipv4地址加端口访问是可以的,但是用域名访问还是不行。原来,访问域名的时候默认访问80端口,那就只能想办法在同一个端口部署多个网站了。方法如下:
进入文件管理:www/server/nginx/conf/nginx.conf
添加这么一段:
1 | server { |
就大功告成了。
Where of what's past is prologue.
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true