Javascript Nuxt build无法与除根域之外的其他连接域一起工作
我需要一些关于nuxtjs构建版本的帮助,该版本在我的主域中运行良好,例如我的域是 test domain.com我的构建工作正常,但在我的另一个连接域中,如test2 domain.com\u numxt文件夹没有捕获,它在\u numxt文件夹中给了我404,所以这个构建基本上是只为我的test domain.com生成的,而不是为其他域生成的 我使用的是Nginx服务器,这里我附上我的nuxt.config.js文件,希望你们能给我一些建议或帮助Javascript Nuxt build无法与除根域之外的其他连接域一起工作,javascript,node.js,nginx,nuxt.js,Javascript,Node.js,Nginx,Nuxt.js,我需要一些关于nuxtjs构建版本的帮助,该版本在我的主域中运行良好,例如我的域是 test domain.com我的构建工作正常,但在我的另一个连接域中,如test2 domain.com\u numxt文件夹没有捕获,它在\u numxt文件夹中给了我404,所以这个构建基本上是只为我的test domain.com生成的,而不是为其他域生成的 我使用的是Nginx服务器,这里我附上我的nuxt.config.js文件,希望你们能给我一些建议或帮助 export default {
export default {
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: 'server',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
head: {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
],
link: [
{ rel: 'stylesheet', type: 'text/css', href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css' }
],
script: [
// { src: 'https://code.jquery.com/jquery-3.5.1.min.js', mode: 'client' },
// { src: 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js', mode: 'client' },
// { src: 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', mode: 'client' },
{ src: '/libs/jquery/dist/jquery.min.js', mode: 'client' },
// { src: '/popover.js', mode: 'client' },
{ src: '/popper.js', mode: 'client' },
{ src: '/libs/bootstrap/dist/js/bootstrap.min.js', mode: 'client' },
// { src: '/libs/@shopify/draggable/lib/es5/draggable.bundle.legacy.js', mode: 'client' },
{ src: '/libs/autosize/dist/autosize.min.js', mode: 'client' },
{ src: '/libs/chart.js/dist/Chart.min.js', mode: 'client' },
{ src: '/libs/dropzone/dist/min/dropzone.min.js', mode: 'client' },
// { src: '/libs/flatpickr/dist/flatpickr.min.js', mode: 'client' },
{ src: '/libs/highlightjs/highlight.pack.min.js', mode: 'client' },
{ src: '/libs/jquery-mask-plugin/dist/jquery.mask.min.js', mode: 'client' },
{ src: '/libs/list.js/dist/list.min.js', mode: 'client' },
{ src: '/libs/quill/dist/quill.min.js', mode: 'client' },
{ src: '/libs/select2/dist/js/select2.full.min.js', mode: 'client' },
{ src: '/libs/chart.js/Chart.extension.js', mode: 'client' },
{ src: '/colorPick.min.js', mode: 'client' },
{ src: '/feather.min.js', mode: 'client' },
{ src: '/custom.js' },
{ src: 'https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.5.9/lottie.min.js', mode: 'client' },
{ src: 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js', mode: 'client' }
]
},
/*
** Global CSS
*/
loading: {
color: '#377dff',
height: '1.5px'
},
css: [
// '@/assets/css/bootstrap.min.css',
'@/assets/css/theme.css',
'@/assets/css/style.css',
'@/assets/fonts/feather/feather.css',
'@/assets/css/colorPick.min.css',
'@/assets/libs/highlightjs/styles/vs2015.css',
'@/assets/libs/quill/dist/quill.core.css',
'@/assets/libs/quill/dist/quill.snow.css',
'@/node_modules/@voerro/vue-tagsinput/dist/style.css',
'@/assets/libs/notyf.css'
// '@/assets/css/select2.min.css'
// '@/assets/libs/flatpickr/dist/flatpickr.min.css'
],
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: [
'~/plugins/general-intialization.js',
'~/plugins/vue-filters.js',
'~/plugins/vee-validate.js',
'~/plugins/axios-interceptor.js',
'~/plugins/service-interceptor.js',
{ src: '~/plugins/vue-plugin-in-nuxt.js', ssr: false },
{ src: '~/plugins/notyf', ssr: false }
],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://http.nuxtjs.org
'@nuxt/http',
'@nuxtjs/axios',
'@nuxtjs/auth',
['cookie-universal-nuxt', { alias: 'cookiz' }]
],
axios: {
// baseURL: 'http://localhost:' + process.env.PORT // Used as fallback if no runtime config is provided
baseURL: '/'
},
auth: {
strategies: {
local: {
endpoints: {
login: { url: '/api/user/signin', method: 'post', propertyName: 'token' },
user: { url: '/api/user/me', method: 'get', propertyName: 'data' },
logout: false
},
redirect: {
login: '/feedback',
logout: '/auth/login'
}
}
}
},
/*
** Server Middleware
*/
serverMiddleware: [
{
path: '/api', handler: '~/server'
}
],
/*
** For deployment you might want to edit host and port
*/
server: {
port: process.env.PORT, // default: 3000
host: 'localhost' // default: localhost
},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {
transpile: [
'vee-validate/dist/rules'
]
},
router: {
extendRoutes (router, resolve) {
router.push({ path: '/', component: resolve(__dirname, '@/pages/feedback/index.vue') })
router.push({ path: '/setting', component: resolve(__dirname, '@/pages/company/index.vue') })
router.push({ path: '/setting/company', component: resolve(__dirname, '@/pages/company/index.vue') })
router.push({ path: '/company/create', component: resolve(__dirname, '@/pages/company/create.vue') })
router.push({ path: '/verify/email', component: resolve(__dirname, '@/pages/verify-email.vue') })
}
}
}
这是服务器级别的问题,我们转移到另一个节点服务器,一切正常,因此,如果有人遇到相同的问题,请尝试使用其他服务器,我希望它也适用于您