配置描述如下:
- Nginx将访问域名反向代理到localhost:3000的site服务;
- nuxt.config.js的配置描述如下:
export default {
server: {
port: 3000,
host: '0.0.0.0',
timing: {
total: true,
},
},
mode: 'universal',
/*
** Headers of the page
/
head: {
htmlAttrs: {
lang: 'zh-cmn-Hans',
},
title: '',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content:
'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui',
},
{ name: 'window-target', content: '_top' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'alternate',
type: 'application/atom+xml',
title: '最新文章',
href: '/atom.xml',
},
{
rel: 'alternate',
type: 'application/atom+xml',
title: '最新话题',
href: '/topic_atom.xml',
},
{
rel: 'alternate',
type: 'application/atom+xml',
title: '最新开源项目',
href: '/project_atom.xml',
},
{
rel: 'stylesheet',
href: '//cdn.staticfile.org/bulma/0.8.0/css/bulma.min.css',
},
{
rel: 'stylesheet',
href: '//at.alicdn.com/t/font_1142441_bu6x3hdokz.css',
},
],
},
/
** Customize the progress-bar color
/
loading: { color: '#FFB90F' },
/
** Global CSS
/
css: [{ src: '~/assets/styles/main.scss', lang: 'scss' }],
/
** Plugins to load before mounting the App
/
plugins: [
'/plugins/filters',
'/plugins/axios',
'/plugins/bbs-go',
{ src: '/plugins/infinite-scroll', ssr: false },
{ src: '~/plugins/vue-lazyload', ssr: false },
],
/
** Nuxt.js dev-modules
/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
],
/
** Nuxt.js modules
/
modules: [
// Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma
// '@nuxtjs/bulma',
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/eslint-module',
'@nuxtjs/toast',
['cookie-universal-nuxt', { alias: 'cookies' }],
[
'@nuxtjs/google-adsense',
{
id: 'ca-pub-5683711753850351',
pageLevelAds: true,
},
],
],
/
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
proxy: true,
credentials: true,
},
proxy: {
'/api/':
process.env.NODE_ENV === 'production'
? 'http://api.shitcoin.chat'
: process.env.NODE_ENV === 'docker'
? 'http://bbs-go-server:8082'
: 'http://172.21.174.102:8082',
},
// Doc: https://github.com/shakee93/vue-toasted
// Doc: https://github.com/nuxt-community/modules/tree/master/packages/toast
toast: {
position: 'top-right',
duration: 2000, // Display time of the toast in millisecond
keepOnHover: true, // When mouse is over a toast's element, the corresponding duration timer is paused until the cursor leaves the element
},
/*
** Build configuration
/
build: {
// publicPath: 'https://file.mlog.club/static/nuxtclient/',
optimizeCSS: true,
extractCSS: true,
splitChunks: {
layouts: true,
pages: true,
commons: true,
},
postcss: {
preset: {
features: {
customProperties: false,
},
},
},
/
** You can extend webpack config here
*/
extend(config, ctx) {},
},
}
- bbs-go.yaml的配置如下:
Env: prod # 环境,线上环境:prod、测试环境:dev
BaseUrl: "" # 网站域名
Port: '8082' # 端口
LogFile: ./data/logs/bbs-go.log # 日志文件
ShowSql: false # 是否打印sql
StaticPath: ./data/www # 根路径下的静态文件目录,可配置绝对路径
数据库连接
MySqlUrl: shitcoin:password@tcp(ip:port)/bbsgo_db?charset=utf8mb4&parseTime=True&loc=Local
github登录配置
Github:
ClientID:
ClientSecret:
qq登录配置
QQConnect:
AppId:
AppKey:
Uploader:
Enable: local
# 阿里云oss配置
Local:
Host: "http://shitcoin.chat"
Path: "./data"
AliyunOss:
Host: 请配置成你自己的
Bucket: 请配置成你自己的
Endpoint: 请配置成你自己的
AccessId: 请配置成你自己的
AccessSecret: 请配置成你自己的
邮件服务器配置,用于邮件通知
Smtp:
Addr: smtp.qq.com
Port: '25'
Username: 请配置成你自己的
Password: 请配置成你自己的
百度ai配置,用于自动分析文章摘要、标签
BaiduAi:
ApiKey:
SecretKey:
操作行为描述: 更新头像图片
site错误输出:
ERROR Cannot read property 'originalUrl' of undefined 11:55:52
at getSignInUrl (middleware/authenticated.js:35:0)
at toSignIn (middleware/authenticated.js:26:0)
at server.js:386:5
at promisify (.nuxt/utils.js:259:0)
at middlewareSeries (.nuxt/utils.js:239:0)
at module.exports.webpack_exports.default (.nuxt/server.js:205:0)
at processTicksAndRejections (internal/process/task_queues.js:97:5)